antvis / F2

📱📈An elegant, interactive and flexible charting library for mobile.
https://f2.antv.vision/zh
MIT License
7.89k stars 649 forks source link

引用官方面积图代码,render报错 #2013

Closed Olaf0509 closed 4 days ago

Olaf0509 commented 4 days ago

image

页面已声明元素 <canvas id="container" height="160px"></canvas>

Reproduction link

https://f2.antv.antgroup.com/zh/examples/area/area/#gradient

Steps to reproduce

/* @jsx jsx / import { jsx, Canvas, Chart, Area, Line, Axis, Tooltip } from '@antv/f2';

const context = document.getElementById('container').getContext('2d');

const data = [ { time: '2016-08-08 00:00:00', tem: 10, }, { time: '2016-08-08 00:10:00', tem: 22, }, { time: '2016-08-08 00:30:00', tem: 16, }, { time: '2016-08-09 00:35:00', tem: 26, }, { time: '2016-08-09 01:00:00', tem: 12, }, { time: '2016-08-09 01:20:00', tem: 26, }, { time: '2016-08-10 01:40:00', tem: 18, }, { time: '2016-08-10 02:00:00', tem: 26, }, { time: '2016-08-10 02:20:00', tem: 12, }, ]; const { props } = (

);

const chart = new Canvas(props); chart.render();

Environment Info
f2 5.4.5
System -
Browser -
Olaf0509 commented 4 days ago

需要安装插件 https://f2.antv.antgroup.com/tutorial/framework/vue