网站首页
百度ECharts
ECharts实例
ECharts入门
地图大全
ECharts官网
源代码:
点击运行 》
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Highcharts 实例 | web建站教程(ipkd.cn)</title> <script src="/js/jquery-1.9.0.min.js"></script> <!-- 引入 highcharts.js --> <script src="/js/highcharts.js"></script> <script src="/js/highcharts-3d.js"></script> </head> <body> <div id="myChart" width='100%' height='450'></div> <script type="text/javascript"> $(document).ready(function() { var chart = { type: 'column', marginTop: 80, marginRight: 40, options3d: { enabled: true, alpha: 15, beta: 15, viewDistance: 25, depth: 40 } }; var title = { text: 'Highcharts图表之堆叠3D柱形图' }; var xAxis = { categories: ['vue', 'html', 'css', 'jquery', 'node'] }; var yAxis = { allowDecimals: false, min: 0, title: { text: '访问量' } }; var tooltip = { headerFormat: '
{point.key}
', pointFormat: '
\u25CF
{series.name}: {point.y} / {point.stackTotal}' }; var plotOptions = { column: { stacking: 'normal', depth: 40 } }; var series= [{ name: '成年男性', data: [5, 3, 4, 7, 2], stack: 'male' }, { name: '未成年男性', data: [3, 4, 4, 2, 5], stack: 'male' }, { name: '成年女性', data: [2, 5, 6, 2, 1], stack: 'female' }, { name: '未成年女性', data: [3, 0, 4, 4, 3], stack: 'female' }]; var json = {}; json.chart = chart; json.title = title; json.xAxis = xAxis; json.yAxis = yAxis; json.tooltip = tooltip; json.plotOptions = plotOptions; json.series = series; $('#myChart').highcharts(json); }); </script> </body> </html>
运行结果: