I am trying to to have a unique value displayed per scatter plot symbol whenever the mouse moves over it ( or user clicks it) using nvd3.js. In the code here, I am able to get a unique value per group and not per symbol.

I think it has to do with some tooltip configuration.

//Configure how the tooltip looks.
chart.tooltipContent(function(key) {
    return '<h3>' + key + '</h3>';
});

But am not sure as to how to modify it per symbol and not per group.

The example is here.

Thanks

有帮助吗?

解决方案

You haven't said what you want the unique text to be, but you could make it the node's position for example:

chart.tooltipContent(function(key, xval, yval) {
  return '<h3>' + xval + "," + yval + '</h3>';
});
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top