echarts使用什么代码写的

2024-12-19 05:17:12
推荐回答(1个)
回答1:

直接上代码:demo下载百度网盘:代码:放2个div,取个id就行。引用写好的js。测试类型echarts代码:1、在BusinessJs/echarts.js中引用echarts及zrender:require.config({packages:[{name:'echarts',location:'./echarts/src',main:'echarts'},{name:'zrender',location:'./zrender/src',//zrender与echarts在同一级目录main:'zrender'}]});require(['echarts','echarts/chart/bar','echarts/chart/pie'],function(ec){varmyChart_Category=ec.init(document.getElementById('div_pieCategory'));varmyChart_Bar=ec.init(document.getElementById('div_bar'));SetTestStatisticsByCategory(ec,myChart_Category);SetTestStatisticsByBeginTime(ec,myChart_Bar);//设置点击事件varecConfig=require('echarts/config');myChart_Category.on(ecConfig.EVENT.PIE_SELECTED,function(param){varselected=param.selected;//debugger;varserieserie=optionpie_category.series[0];if(jQuery.inArray(true,selected[0])>-1){for(vari=0;i