From 77faead4e948f901fa6ca9951f085bbe045bae68 Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Mon, 7 Nov 2016 15:43:13 -0500 Subject: Updated vis library to 4.17 and also linked to only graph2d-timeline CSS and JS --- www/lib/vis/examples/graph3d/11_tooltips.html | 24 +++++++++++++++++----- www/lib/vis/examples/graph3d/playground/index.html | 4 ++++ .../vis/examples/graph3d/playground/playground.js | 1 + 3 files changed, 24 insertions(+), 5 deletions(-) (limited to 'www/lib/vis/examples/graph3d') 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 @@ @@ -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: ' + point.z + ''; + // parameter point contains properties x, y, z, and data + // data is the original object passed to the point constructor + return 'value: ' + point.z + '
' + point.data.extra; }, keepAspectRatio: true, @@ -99,6 +112,7 @@
-
+
Hover the mouse cursor over the graph to see tooltips.
+ 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 @@ -116,6 +116,10 @@ showPerspective + + showLegend + + showShadow 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, -- cgit v1.2.3