实例:生成柱形图表。
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> <div style="height: 500px;"> <div id="i1"></div> </div> </body> <script src="jquery-1.12.4.js"></script> <script src="highchart/highcharts.js"></script> <script> function createchart(){ $('#i1').highcharts({ chart: { type: 'bar' }, title: { text: 'Stacked bar chart' }, xAxis: { categories: ['Apples', 'Oranges', 'Pears', 'Grapes', 'Bananas'] }, yAxis: { min: 0, title: { text: 'Total fruit consumption' } }, legend: { reversed: true }, plotOptions: { series: { stacking: 'normal' } }, series: [{ name: 'John', data: [5, 3, 4, 7, 2] }, { name: 'Jane', data: [2, 2, 3, 2, 1] }, { name: 'Joe', data: [3, 4, 4, 2, 5] }] }); } setInterval("createchart()",7200); </script> </html>
highchart参考。。。