areski / python-nvd3

Python Wrapper for NVD3 - It's time for beautiful charts
Other
661 stars 194 forks source link

adding custom tooltips #131

Open kouroshparsa opened 7 years ago

kouroshparsa commented 7 years ago

Hi. It would be nice to have custom tooltips passed in as a list. For example:

chart.add_serie(y=[1, 2, 3], x=[1, 2, 3], tooltips=['A', 'B', 'C'])
areski commented 7 years ago

That's a great idea, but it would be great if you can offer a PR for that. Ideally this should support what we currently have:

extra_serie = {"tooltip": {"y_start": "There is ", "y_end": " calls"}}

Maybe we could consider something like:

chart.add_serie(y=[1, 2, 3], x=[1, 2, 3], tooltips=['A: #xval', 'B: #xval', 'C: #xval'])

where #xval & #yval would replaced by their respective value.