From: Steven Jardine Date: Thu, 9 Sep 2010 17:06:32 +0000 (-0600) Subject: Added documentation for labelsDiv option using just an element id and for labelsShowZ... X-Git-Tag: v1.0.0~664^2~2 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=52fe05c1403e302237b96d6527ee02c075728b9b;p=dygraphs.git Added documentation for labelsDiv option using just an element id and for labelsShowZeroValues. --- diff --git a/docs/index.html b/docs/index.html index 7d9b180..a109aa0 100644 --- a/docs/index.html +++ b/docs/index.html @@ -604,10 +604,18 @@ perl -ne 'BEGIN{print "Month,Nominal,Real\n"} chomp; ($m,$cpi,$low,$close,$high) labelsDiv - document.
getElementById('foo')
+ document.getElementById('foo')
or
'foo' null - Show data labels in an external div, rather than on the graph. -
Tests: demo label-div
+ Show data labels in an external div, rather than on the graph. This value can either be a div element or a div id. +
Tests: label-div
+ + + + labelsShowZeroValues + boolean + true + Show zero value labels in the labelsDiv. +
Tests: label-div
diff --git a/tests/data.js b/tests/data.js index 9dbdc27..5f61b95 100644 --- a/tests/data.js +++ b/tests/data.js @@ -435,3 +435,15 @@ return "" + "20061129,1.41093474427,0.495309102312,3.02013422819,0.701020603129"; } +function data_showzerovalues() { + return "" + + "20070101,0,39\n" + + "20070102,62,0\n" + + "20070103,0,42\n" + + "20070104,57,0\n" + + "20070105,65,44\n" + + "20070106,55,44\n" + + "20070107,0,45\n" + + "20070108,66,0\n" + + "20070109,0,39\n"; + } diff --git a/tests/label-div.html b/tests/label-div.html index 98fdf0f..0231d91 100644 --- a/tests/label-div.html +++ b/tests/label-div.html @@ -17,6 +17,28 @@    
+

+ The following chart should be the same as above. Here we use the + labelsDiv id instead of the actual labelsDiv element.
This is + useful when the labelsDiv element has not been attached to the + DOM when the chart/options is created: +

+ + + + +
   
+

+ The following chart shows the labelsShowZeroValues option in use. + When any point has a zero value the label is not shown. This is + useful when there are many zero values in a point and the user + is only interested in the non-zero points. +

+ + + + +