'add a tooltip to 2graph vis.js library

I am using a 2d line graph of vis.js (http://visjs.org/graph2d_examples.html ). Is there any way to add a tooltip to the data points so that when you mouse over or click you see the value in a pop up or somewhere else?



Solution 1:[1]

This solution is rather simpe:

Add label to points, eg.

var point = {
    x: ...,
    y: ...,
    label: {
        content: POINT_LABEL
    }
};

points.push(point);

var dataset = new vis.DataSet(points);

Reference: https://github.com/almende/vis/issues/282#issuecomment-217528166

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Dee