X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=experimental%2Fpalette%2Fsamples.js;h=aa84c39da42da10c8d0c7e85e52996893ffafef0;hb=68c27ff931144658a04facb8be769e736b0db9d6;hp=55da365a1338a260a071e444e74688971f6545f5;hpb=2b3ebdd94ffd4599b9ca75676819d7a58d70a39e;p=dygraphs.git diff --git a/experimental/palette/samples.js b/experimental/palette/samples.js index 55da365..aa84c39 100644 --- a/experimental/palette/samples.js +++ b/experimental/palette/samples.js @@ -61,7 +61,11 @@ Samples.data = [ ylabel: 'Count', axisLineColor: 'white', drawXGrid: false, - pointClickCallback: function() { alert("p-click!"); }, + +// This indentation is intentional; do not fix. + pointClickCallback: function() { + alert("p-click!"); +} } }, @@ -133,6 +137,50 @@ Samples.data = [ customBars: true, errorBars: true } + }, + + { + id: "perSeries", + title: "Per Series Options", + data: function() { + var zp = function(x) { if (x < 10) return "0"+x; else return x; }; + var r = "date,parabola,line,another line,sine wave,sine wave2\n"; + for (var i=1; i<=31; i++) { + r += "200610" + zp(i); + r += "," + 10*(i*(31-i)); + r += "," + 10*(8*i); + r += "," + 10*(250 - 8*i); + r += "," + 10*(125 + 125 * Math.sin(0.3*i)); + r += "," + 10*(125 + 125 * Math.sin(0.3*i+Math.PI)); + r += "\n"; + } + return r; + }, + options: { + strokeWidth: 2, + series : { + 'parabola': { + strokeWidth: 0.0, + drawPoints: true, + pointSize: 4, + highlightCircleSize: 6 + }, + 'line': { + strokeWidth: 1.0, + drawPoints: true, + pointSize: 1.5 + }, + 'sine wave': { + strokeWidth: 3, + highlightCircleSize: 10 + }, + 'sine wave2': { + strokePattern: [10, 2, 5, 2], + strokeWidth: 2, + highlightCircleSize: 3 + } + } + } } ];