Closed bpfennig closed 7 years ago
Hi @bpfennig
You can definitley do this, have you already seen the Custom Tooltip section in the docs http://n3-charts.github.io/line-chart/#/docs ?
You can easily put this information in your data array and pull it out from the raw
property (for this feature you have to use the latest n3-line-charts version). Here is an example: https://codepen.io/chaosmail/full/JJGgOR/
Best, Christoph
Hi Christoph,
thanks for the quick reply!
Yes I saw that but wondered why this item didn't show up for me. With the beta of version 3 this works fine now, thank you for adding this feature!
Cheers, Benedikt
Great, glad this helped you! Best, Christoph
Hi guys!
First of all: thank you for this useful tool that has helped me a lot up to now!
One thing I stumbled upon again and again are the custom tooltips. Is there any way to spice them up with some extra meta data for each data point in a series?
For example (this is what I would use it for): I have a system that runs tests. For distinct time periods I want to see how many tests have failed. So each data point in the series represents the relative number (percentage) of failures for a given time period. I use a ['dot', 'line', 'area'] series for this with one value always at 0 for visual reasons (area below graph is filled).
Now I want the tooltip to also show the absolute number of tests that were run in the respective periods (which is non-deterministic and thus different for every data point, which is why I can't store that info in the series object). Unfortunately I can't use the y0 key for this (which has to be 0) because this would mess up the area series. Ideally I would be able to have access to additional values I stored with the graphData.
Actually it is not quite clear for me, too, where the "data" parameter of tooltipHook: function ( data ) { ... } comes from. It seems there is no way to get extra info into that.
I hope that you can understand my problem and maybe you can help me with this.
Cheers, Benedikt