| OLD | NEW |
| (Empty) |
| 1 <!doctype html> | |
| 2 | |
| 3 <!--[if lte IE 8]><SCRIPT src='source/excanvas.js'></script><![endif]--><SCRIPT
src='../ChartNew.js'></script> | |
| 4 | |
| 5 | |
| 6 <SCRIPT> | |
| 7 | |
| 8 function setColor(area,data,config,i,j,animPct,value) | |
| 9 { | |
| 10 if(value > 35)return("rgba(220,0,0,"+animPct); | |
| 11 else return("rgba(0,220,0,"+animPct); | |
| 12 | |
| 13 } | |
| 14 | |
| 15 var charJSPersonnalDefaultOptions = { decimalSeparator : "," , thousandSeparator
: ".", roundNumber : "none", graphTitleFontSize: 2 }; | |
| 16 | |
| 17 defCanvasWidth=600; | |
| 18 defCanvasHeight=300; | |
| 19 | |
| 20 | |
| 21 var mydata1 = { | |
| 22 labels : ["January","February","March","April","May","June","July"], | |
| 23 // labels : ["January"], | |
| 24 datasets : [ | |
| 25 { | |
| 26 fillColor : "rgba(220,220,220,0.5)", | |
| 27 strokeColor : "rgba(220,220,220,1)", | |
| 28 pointColor : "rgba(220,220,220,1)", | |
| 29 pointstrokeColor : "yellow", | |
| 30 axis : 2, | |
| 31 data : [95,53,99,,73,27,82], | |
| 32 // data : [40], | |
| 33 | |
| 34 title : "2014" | |
| 35 }, | |
| 36 { | |
| 37 fillColor : "rgba(151,187,205,0.5)", | |
| 38 strokeColor : "rgba(151,187,205,1)", | |
| 39 pointColor : "green", | |
| 40 pointstrokeColor : "yellow", | |
| 41 data : [35,43,59,,31,50,66], | |
| 42 axis : 1, | |
| 43 // data : [35], | |
| 44 title : "2013" | |
| 45 } | |
| 46 ] | |
| 47 } | |
| 48 | |
| 49 var startWithDataset =1; | |
| 50 var startWithData =1; | |
| 51 | |
| 52 var opt1 = { | |
| 53 animationStartWithDataset : startWithDataset, | |
| 54 animationStartWithData : startWithData, | |
| 55 animationSteps : 200, | |
| 56 canvasBorders : true, | |
| 57 canvasBordersWidth : 3, | |
| 58 canvasBordersColor : "black", | |
| 59 graphTitle : "default animation", | |
| 60 legend : true, | |
| 61 inGraphDataShow : true, | |
| 62 annotateDisplay : true, | |
| 63 graphTitleFontSize: 18, | |
| 64 yAxisRight : true | |
| 65 | |
| 66 } | |
| 67 | |
| 68 var opt2 = { | |
| 69 animationStartWithDataset : startWithDataset, | |
| 70 animationStartWithData : startWithData, | |
| 71 animationLeftToRight : true, | |
| 72 animationSteps : 200, | |
| 73 animationEasing: "linear", | |
| 74 canvasBorders : true, | |
| 75 canvasBordersWidth : 3, | |
| 76 canvasBordersColor : "black", | |
| 77 graphTitle : "animationLeftToRight=true", | |
| 78 legend : true, | |
| 79 inGraphDataShow : true, | |
| 80 annotateDisplay : true, | |
| 81 graphTitleFontSize: 18, | |
| 82 yAxisRight : true | |
| 83 | |
| 84 } | |
| 85 | |
| 86 var opt3 = { | |
| 87 animationStartWithDataset : startWithDataset, | |
| 88 animationStartWithData : startWithData, | |
| 89 animationByDataset : true, | |
| 90 animationSteps : 200, | |
| 91 animationEasing: "linear", | |
| 92 canvasBorders : true, | |
| 93 canvasBordersWidth : 3, | |
| 94 canvasBordersColor : "black", | |
| 95 graphTitle : "animationByDataset=true", | |
| 96 | |
| 97 legend : true, | |
| 98 inGraphDataShow : true, | |
| 99 annotateDisplay : true, | |
| 100 graphTitleFontSize: 18, | |
| 101 yAxisRight : true | |
| 102 | |
| 103 } | |
| 104 | |
| 105 var opt4 = { | |
| 106 animationStartWithDataset : startWithDataset, | |
| 107 animationStartWithData : startWithData, | |
| 108 animationLeftToRight : true, | |
| 109 animationByDataset : true, | |
| 110 animationSteps : 200, | |
| 111 animationEasing: "linear", | |
| 112 canvasBorders : true, | |
| 113 canvasBordersWidth : 3, | |
| 114 canvasBordersColor : "black", | |
| 115 graphTitle : "animationByDataset=true & animationLeftToRight=true ", | |
| 116 legend : true, | |
| 117 inGraphDataShow : true, | |
| 118 annotateDisplay : true, | |
| 119 graphTitleFontSize: 18, | |
| 120 yAxisRight : true | |
| 121 | |
| 122 } | |
| 123 | |
| 124 | |
| 125 </SCRIPT> | |
| 126 | |
| 127 | |
| 128 <html> | |
| 129 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> | |
| 130 <head> | |
| 131 <title>Demo ChartNew.js</title> | |
| 132 </head> | |
| 133 <body> | |
| 134 | |
| 135 <center> | |
| 136 <FONT SIZE=6><B>Demo of ChartNew.js !</B></FONT> <BR> | |
| 137 | |
| 138 <script> | |
| 139 | |
| 140 document.write("<canvas id=\"canvas_Line1\" height=\""+defCanvasHeight+"\" w
idth=\""+defCanvasWidth+"\"></canvas>"); | |
| 141 document.write("<canvas id=\"canvas_Line2\" height=\""+defCanvasHeight+"\" w
idth=\""+defCanvasWidth+"\"></canvas>"); | |
| 142 document.write("<canvas id=\"canvas_Line3\" height=\""+defCanvasHeight+"\" w
idth=\""+defCanvasWidth+"\"></canvas>"); | |
| 143 document.write("<canvas id=\"canvas_Line4\" height=\""+defCanvasHeight+"\" w
idth=\""+defCanvasWidth+"\"></canvas>"); | |
| 144 window.onload = function() { | |
| 145 | |
| 146 | |
| 147 var myLine = new Chart(document.getElementById("canvas_Line1").getContext("2
d")).Line(mydata1,opt1); | |
| 148 var myLine = new Chart(document.getElementById("canvas_Line2").getContext("2
d")).Line(mydata1,opt2); | |
| 149 var myLine = new Chart(document.getElementById("canvas_Line3").getContext("2
d")).Line(mydata1,opt3); | |
| 150 var myLine = new Chart(document.getElementById("canvas_Line4").getContext("2
d")).Line(mydata1,opt4); | |
| 151 } | |
| 152 </script> | |
| 153 </body> | |
| 154 </html> | |
| OLD | NEW |