Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(481)

Side by Side Diff: bower_components/chartnewjs/Samples/plot_graph.html

Issue 786953007: npm_modules: Fork bower_components into Polymer 0.4.0 and 0.5.0 versions (Closed) Base URL: https://chromium.googlesource.com/infra/third_party/npm_modules.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <!doctype html>
2
3 <!--[if lte IE 8]><SCRIPT src='source/excanvas.js'></script><![endif]--><SCRIPT src='../ChartNew.js'></script>
4 <SCRIPT src='../Add-ins/format.js'></script>
5 <SCRIPT src='../Add-ins/stats.js'></script>
6
7 <SCRIPT>
8
9 var charJSPersonalDefaultOptions = { decimalSeparator : "," , thousandSeparator : ".", roundNumber : "none", graphTitleFontSize: 2 };
10
11 defCanvasWidth=1200;
12 defCanvasHeight=600;
13
14
15 var mydata1 = {
16 labels : [0,5,10,15,20,25,30],
17 datasets : [
18 {
19 pointColor : "black",
20 strokeColor : "rgba(0,0,0,0)",
21 pointStrokeColor : "black",
22 data : [12.1,25.3,7.9,9.1,31.3,28.1,24.5,19.8,27.1,25.6, 18.9,16.8,23.2,10.1,13,15.5],
23 xPos : [12.2,14.5,13.1,4.2,25.7,28.6,27.3,20.5,23.1,26.9,15.2,17.1,19.4,7. 6,8.5,11.3],
24 title : "points"
25 },
26 {
27 pointColor : "rgba(0,0,0,0)",
28 strokeColor : "red",
29 pointStrokeColor : "rgba(0,0,0,0)",
30 data : ["<%=#linear_regression_b0#%>",,,,,,"<%=#linear_r egression_b0#+30*#linear_regression_b1#%>"],
31 title : "regression line"
32 }
33 ]
34 }
35
36
37 var opt1 = {
38 canvasBorders : true,
39 canvasBordersWidth : 3,
40 canvasBordersColor : "black",
41 datasetFill : false,
42 graphTitle : "Regression line: <%=roundToNumber(#linear_regression_b0#,-2 )%>+<%=roundToNumber(#linear_regression_b1#,-2)%>*X",
43 graphTitleFontSize: 18,
44 graphMin : 0,
45 yAxisMinimumInterval : 5,
46 bezierCurve: false,
47 inGraphDataShow : true,
48 inGraphDataTmpl : "<%=(v1 == 'regression line' ? '' : '('+v2 + ';' + v3 + ')')%>",
49
50 }
51
52 function roundToNumber(num, place) {
53 var newval=1*num;
54
55 if(typeof(newval)=="number"){
56 if(place<=0){
57 var roundVal=-place;
58 newval= +(Math.round(newval + "e+" + roundVal) + "e-" + roundVal);
59 }
60 else {
61 var roundVal=place;
62 var divval= "1e+"+roundVal;
63 newval= +(Math.round(newval/divval))*divval;
64 }
65 }
66 return(newval);
67 } ;
68
69 stats(mydata1,opt1);
70
71 </SCRIPT>
72
73
74 <html>
75 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
76 <head>
77 <title>Demo ChartNew.js</title>
78 </head>
79 <body>
80
81 <center>
82 <FONT SIZE=6><B>Demo of ChartNew.js !</B></FONT> <BR>
83
84 <script>
85
86 document.write("<canvas id=\"canvas_Line1\" height=\""+defCanvasHeight+"\" w idth=\""+defCanvasWidth+"\"></canvas>");
87 window.onload = function() {
88
89
90 var myLine = new Chart(document.getElementById("canvas_Line1").getContext("2 d")).Line(mydata1,opt1);
91 }
92 </script>
93 </body>
94 </html>
OLDNEW
« no previous file with comments | « bower_components/chartnewjs/Samples/negativeLineAnim.html ('k') | bower_components/chartnewjs/Samples/responsiveChart.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698