Added pixelRatio option to override canvas upscaling. Resolves #876, test included...
[dygraphs.git] / gallery / per-series.js
1 /*global Gallery,Dygraph,data */
2 Gallery.register(
3 'per-series',
4 {
5 name: 'Per-series properties',
6 title: 'Chart with per-series properties',
7 setup: function(parent) {
8 parent.innerHTML = "<div id='demodiv'>";
9 },
10 run: function() {
11 new Dygraph(
12 document.getElementById("demodiv"),
13 function() {
14 var zp = function(x) { if (x < 10) return "0"+x; else return x; };
15 var r = "date,parabola,line,another line,sine wave\n";
16 for (var i=1; i<=31; i++) {
17 r += "200610" + zp(i);
18 r += "," + 10*(i*(31-i));
19 r += "," + 10*(8*i);
20 r += "," + 10*(250 - 8*i);
21 r += "," + 10*(125 + 125 * Math.sin(0.3*i));
22 r += "\n";
23 }
24 return r;
25 },
26 {
27 strokeWidth: 2,
28 series: {
29 'parabola': {
30 strokeWidth: 0.0,
31 drawPoints: true,
32 pointSize: 4,
33 highlightCircleSize: 6
34 },
35 'line': {
36 strokeWidth: 1.0,
37 drawPoints: true,
38 pointSize: 1.5
39 },
40 'sine wave': {
41 strokeWidth: 3,
42 highlightCircleSize: 10
43 }
44 }
45 }
46 );
47 }
48 });