Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jul 29, 2019. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 16 additions & 9 deletions examples/graph3d/11_tooltips.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -24,11 +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',
];
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
Expand All @@ -42,7 +48,7 @@
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, extra: extra_content[(x*y) % extra_content.length]});
data.add({x:x, y:y, z: z, extra: extra_content[(x*y) % extra_content.length]});
}
}
}
Expand All @@ -61,8 +67,8 @@
//tooltip: true,
tooltip: function (point) {
// 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;
// data is the original object passed to the point constructor
return 'value: <b>' + point.z + '</b><br>' + point.data.extra;
},

keepAspectRatio: true,
Expand Down Expand Up @@ -106,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>