1 | <script src="js/jquery-1.7.2.min.js"></script>
|
---|
2 | <script src="js/highcharts.js"></script>
|
---|
3 | <script src="js/exporting.js"></script>
|
---|
4 | <script type="text/javascript">
|
---|
5 | $(document).ready(function(){
|
---|
6 | var chart = new Highcharts.Chart({
|
---|
7 | chart: {
|
---|
8 | renderTo: 'container' /* display to div Graph*/
|
---|
9 | },
|
---|
10 |
|
---|
11 | xAxis: {
|
---|
12 | labels: {
|
---|
13 | rotation: -45,
|
---|
14 | align: 'right',
|
---|
15 | },
|
---|
16 | categories:["","","","","","","","19:00","20:00","21:00","22:00","23:00","24:00","1:00","2:00","3:00","4:00","5:00","6:00","7:00"]},
|
---|
17 | series:[{ data:[[19,200],[22,333],[24,60],[27,40],]}], /* array of Data */
|
---|
18 |
|
---|
19 | remove:function()
|
---|
20 | {
|
---|
21 | return false;
|
---|
22 | },
|
---|
23 |
|
---|
24 | exporting: { /*--------------------*/
|
---|
25 | buttons: { /* */
|
---|
26 | exportButton: { /* Export */
|
---|
27 | menuItems: null, /* to */
|
---|
28 | onclick: function() { /* PNG.file */
|
---|
29 | this.exportChart(); /*--------------------*/
|
---|
30 | }
|
---|
31 | }
|
---|
32 | }
|
---|
33 | },
|
---|
34 |
|
---|
35 | plotOptions:
|
---|
36 | {
|
---|
37 | series: {
|
---|
38 | marker: {
|
---|
39 | enabled: false,
|
---|
40 |
|
---|
41 | },
|
---|
42 |
|
---|
43 | events: {
|
---|
44 | legendItemClick: function(event) {
|
---|
45 |
|
---|
46 |
|
---|
47 | }
|
---|
48 | }
|
---|
49 |
|
---|
50 | }
|
---|
51 | },
|
---|
52 |
|
---|
53 | });
|
---|
54 | $('#add').click(function() {
|
---|
55 | if (chart.series.length == 1) {
|
---|
56 | chart.addSeries({
|
---|
57 | data: [194.1, 95.6, 54.4, 29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4]
|
---|
58 | });
|
---|
59 | }
|
---|
60 | });
|
---|
61 |
|
---|
62 |
|
---|
63 |
|
---|
64 | });
|
---|
65 |
|
---|
66 | </script>
|
---|
67 |
|
---|
68 | <div id="container" style="width:100%; height:435px"></div> |
---|