javascript: var script = document.createElement('script'); script.type = "text/javascript"; script.src ="https://cdn.jsdelivr.net/npm/echarts/dist/echarts.min.js"; document.head.appendChild(script); setTimeout(function(){ var dom =$('[data-label=test]').get(0); var myChart = echarts.init(dom); var option = { dataset: [ { dimensions: ['name', 'age', 'profession', 'score', 'date'], source: [ ['Hannah Krause', 41, 'Engineer', 314, '2011-02-12'], ['Zhao Qian', 20, 'Teacher', 351, '2011-03-01'], ['Jasmin Krause ', 52, 'Musician', 287, '2011-02-14'], ['Li Lei', 37, 'Teacher', 219, '2011-02-18'], ['Karle Neumann', 25, 'Engineer', 253, '2011-04-02'], ['Adrian Groß', 19, 'Teacher', '-', '2011-01-16'], ['Mia Neumann', 71, 'Engineer', 165, '2011-03-19'], ['Böhm Fuchs', 36, 'Musician', 318, '2011-02-24'], ['Han Meimei', 67, 'Engineer', 366, '2011-03-12'] ] }, { transform: { type: 'sort', config: { dimension: 'score', order: 'desc' } } } ], xAxis: { type: 'category', axisLabel: { interval: 0, rotate: 30 } }, yAxis: {}, series: { type: 'bar', encode: { x: 'name', y: 'score' }, datasetIndex: 1 } }; if (option && typeof option === "object"){ myChart.setOption(option, true); }}, 800);
标签:02,option,script,type,加入,axuer,图表,var,2011 From: https://www.cnblogs.com/helow/p/16962608.html