微信扫一扫看面试题

关注面试题库

Echart 使用

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

在这里插入图片描述

// 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;
// }

在小程序中体验

在这里插入图片描述

posted @   web前端面试小助手  阅读(133)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
点击右上角即可分享
微信分享提示