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

Side by Side Diff: bower_components/chartnewjs/Samples/stats_doughnut.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 <SCRIPT src='..\ChartNew.js'></script>
4 <SCRIPT src='..\Add-ins\stats.js'></script>
5
6 <SCRIPT>
7
8 defCanvasWidth=1200;
9 defCanvasHeight=600;
10
11 var mydata1 = [
12 {
13 value : 30,
14 color: "#D97041",
15 title : "data1"
16 },
17 {
18 value : 90,
19 color: "#C7604C",
20 title : "data2"
21 },
22 {
23 value : 24,
24 color: "#21323D",
25 title : "data3"
26 },
27 {
28 value : 58,
29 color: "#9D9B7F",
30 title : "data4"
31 },
32 {
33 value : 82,
34 color: "#7D4F6D",
35 title : "data5"
36 },
37 {
38 value : 8,
39 color: "#584A5E",
40 title : "data6"
41 }
42 ];
43
44
45 var varcrosstxt = {
46 canvasBordersWidth : 3,
47 canvasBordersColor : "black",
48 crossText : ["Total:\n#sum#"],
49 crossTextIter: ["all"],
50 crossTextOverlay : [true],
51 crossTextFontSize : [50],
52 crossTextFontColor : ["black"],
53 crossTextRelativePosX : [2],
54 crossTextRelativePosY : [2],
55 crossTextAlign : ["center"],
56 crossTextBaseline : ["middle"],
57 inGraphDataShow : true,
58 legend : true,
59 canvasBorders : true,
60 graphTitle : "Sample - Sum of the data in the middle",
61 graphTitleFontFamily : "'Arial'",
62 graphTitleFontSize : 24,
63 graphTitleFontStyle : "bold",
64 graphTitleFontColor : "#666",
65 footNoteFontSize : 15,
66 footNote : "Mean Value : <%=roundToNumber(#MEAN#,-2)%> - Standard Deviatio n : <%=roundToNumber(#standard_deviation#,-2)%>"
67 }
68
69 function roundToNumber(num, place) {
70 var newval=1*num;
71
72 if(typeof(newval)=="number"){
73 if(place<=0){
74 var roundVal=-place;
75 newval= +(Math.round(newval + "e+" + roundVal) + "e-" + roundVal);
76 }
77 else {
78 var roundVal=place;
79 var divval= "1e+"+roundVal;
80 newval= +(Math.round(newval/divval))*divval;
81 }
82 }
83 return(newval);
84 } ;
85
86 function roundToNumber(num, place) {
87 var newval=1*num;
88
89 if(typeof(newval)=="number"){
90 if(place<=0){
91 var roundVal=-place;
92 newval= +(Math.round(newval + "e+" + roundVal) + "e-" + roundVal);
93 }
94 else {
95 var roundVal=place;
96 var divval= "1e+"+roundVal;
97 newval= +(Math.round(newval/divval))*divval;
98 }
99 }
100 return(newval);
101 } ;
102
103 </SCRIPT>
104
105 <html>
106 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
107 <head>
108 <title>Demo ChartNew.js</title>
109
110 </head>
111 <body>
112
113 <script>
114
115 stats(mydata1,varcrosstxt);
116
117 document.write("<canvas id=\"canvas_pie\" height=\""+defCanvasHeight+"\" width =\""+defCanvasWidth+"\"></canvas>");
118
119 window.onload = function() {
120 var myBar = new Chart(document.getElementById("canvas_pie").getContext("2d ")).Doughnut(mydata1,varcrosstxt);
121 }
122 </script>
123 </body>
124 </html>
OLDNEW
« no previous file with comments | « bower_components/chartnewjs/Samples/stats_bar.html ('k') | bower_components/chartnewjs/Samples/time_graph.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698