网站首页
百度ECharts
ECharts实例
ECharts入门
地图大全
ECharts官网
源代码:
点击运行 》
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>ECharts 实例</title> <script src="/js/jquery-1.9.0.min.js"></script> <!-- 引入 echarts.js --> <script src="/js/echarts.min.js"></script> </head> <body> <div id="main" style="width: 100%;height:380px;"></div> <script type="text/javascript"> var option = { title: { text: '堆积图示例' }, tooltip: {}, legend: { data: ['系列1', '系列2', '系列3'] }, xAxis: { data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'] }, yAxis: {}, series: [{ name: '系列1', type: 'bar', stack: '总量', data: [120, 132, 101, 134, 90, 230, 210] }, { name: '系列2', type: 'bar', stack: '总量', data: [220, 182, 191, 234, 290, 330, 310] }, { name: '系列3', type: 'bar', stack: '总量', data: [150, 232, 201, 154, 190, 330, 410] }] }; var myChart = echarts.init(document.getElementById('main')); myChart.setOption(option); </script> </body> </html>
运行结果: