diff options
Diffstat (limited to 'www/lib/vis/examples/graph3d')
| -rw-r--r-- | www/lib/vis/examples/graph3d/11_tooltips.html | 24 | ||||
| -rw-r--r-- | www/lib/vis/examples/graph3d/playground/index.html | 4 | ||||
| -rw-r--r-- | www/lib/vis/examples/graph3d/playground/playground.js | 1 |
3 files changed, 24 insertions, 5 deletions
diff --git a/www/lib/vis/examples/graph3d/11_tooltips.html b/www/lib/vis/examples/graph3d/11_tooltips.html index 6ae32a39..c37b35f4 100644 --- a/www/lib/vis/examples/graph3d/11_tooltips.html +++ b/www/lib/vis/examples/graph3d/11_tooltips.html @@ -5,6 +5,12 @@ <style> body {font: 10pt arial;} + div#info { + width : 600px; + text-align: center; + margin-top: 2em; + font-size : 1.2em; + } </style> <script type="text/javascript" src="../../dist/vis.js"></script> @@ -24,6 +30,11 @@ // Create and populate a data table. data = new vis.DataSet(); + var extra_content = [ + 'Arbitrary information', + 'You can access data from the point source object', + 'Tooltip example content', + ]; // create some nice looking data with sin/cos var steps = 5; // number of datapoints will be steps*steps @@ -34,10 +45,10 @@ var z = custom(x,y); if (withValue) { var value = (y - x); - data.add({x:x, y:y, z: z, style:value}); + data.add({x:x, y:y, z: z, style:value, extra: extra_content[(x*y) % extra_content.length]}); } else { - data.add({x:x, y:y, z: z}); + data.add({x:x, y:y, z: z, extra: extra_content[(x*y) % extra_content.length]}); } } } @@ -48,14 +59,16 @@ height: '600px', style: style, showPerspective: true, + showLegend: true, showGrid: true, showShadow: false, // Option tooltip can be true, false, or a function returning a string with HTML contents //tooltip: true, tooltip: function (point) { - // parameter point contains properties x, y, z - return 'value: <b>' + point.z + '</b>'; + // parameter point contains properties x, y, z, and data + // data is the original object passed to the point constructor + return 'value: <b>' + point.z + '</b><br>' + point.data.extra; }, keepAspectRatio: true, @@ -99,6 +112,7 @@ <div id="mygraph"></div> -<div id="info"></div> +<div id="info">Hover the mouse cursor over the graph to see tooltips.</div> + </body> </html> diff --git a/www/lib/vis/examples/graph3d/playground/index.html b/www/lib/vis/examples/graph3d/playground/index.html index 4f42260e..134bb264 100644 --- a/www/lib/vis/examples/graph3d/playground/index.html +++ b/www/lib/vis/examples/graph3d/playground/index.html @@ -117,6 +117,10 @@ <td><input type="checkbox" id="showPerspective" checked /></td> </tr> <tr> + <td>showLegend</td> + <td><input type="checkbox" id="showLegend" checked /></td> + </tr> + <tr> <td>showShadow</td> <td><input type="checkbox" id="showShadow" /></td> </tr> diff --git a/www/lib/vis/examples/graph3d/playground/playground.js b/www/lib/vis/examples/graph3d/playground/playground.js index 5b93dddb..a2e28728 100644 --- a/www/lib/vis/examples/graph3d/playground/playground.js +++ b/www/lib/vis/examples/graph3d/playground/playground.js @@ -407,6 +407,7 @@ function getOptions() { showAnimationControls: (document.getElementById("showAnimationControls").checked != false), showGrid: (document.getElementById("showGrid").checked != false), showPerspective: (document.getElementById("showPerspective").checked != false), + showLegend: (document.getElementById("showLegend").checked != false), showShadow: (document.getElementById("showShadow").checked != false), keepAspectRatio: (document.getElementById("keepAspectRatio").checked != false), verticalRatio: document.getElementById("verticalRatio").value, |
