Echart 使用

2023-03-09

查看前端面试题小程序 大量面试题和答案,请微信查看

// var list = [1,1,54,5,5,85,8,8,5,5,8,8,85,8,8,5,5,85,88,85,8,88,8,8,8,8,88,]; //x轴的 时间
// var list1= []; //温度数据
// var list2=[] //湿度数据 // function initChart(canvas, width, height) {
// const chart = echarts.init(canvas, null, {width: width,height: height});
// canvas.setChart(chart);
// var option = {
// tooltip: {trigger: 'axis'},
// color: ['#F8DF64', '#76FB4C'], //icon颜色
// legend: {
// data: [{name:'温度(℃)',textStyle: {color: '#333'},color:'#000'},
// { name: '湿度(%RH)', textStyle: { color: '#333' }}], y: 'bottom',
// },
// grid: {left: '1%',right: '1%',top: '10%',containLabel: true}, //图形的位置
// // x坐标
// xAxis: {type: 'category',boundaryGap: false,data: list,name: '',nameGap: 2,axisLabel: {interval: 0}}, // // y坐标
// yAxis: {type: 'value',min: -30,max: 120},
// series: [
// {
// name: '温度(℃)',
// type: 'line',
// stack: '总量',
// smooth: true,
// itemStyle: {normal: {lineStyle: {color: '#F8DF64'}}},
// data: list1
// }, {
// name: '湿度(%RH)',
// type: 'line',
// smooth: true,
// stack: '总量',
// itemStyle: {normal: {lineStyle: {color: '#76FB4C'}}},
// data: list2
// }
// ]
// };
// chart.setOption(option);
// return chart;
// }

在小程序中体验

Echart 使用的相关教程结束。

《Echart 使用.doc》

下载本文的Word格式文档,以方便收藏与打印。