I'm trying to get some tooltips on my pie charts like in the demo (http://gionkunz.github.io/chartist-js/getting-started.html#adding-behaviour-to-your-charts)
The only way i see now is to show the labels hide them via css and get the values with js and insert them in the div i want them to be...
It would be great if i could get the labels in an data-attribut like 'ct-series-name' in the demo above.
Thanks in advance
You need to use the object notation in the series array, then you'll have series name available. I've put together this small example that uses the jquery Tooltipster plugin, just to show how easy it is to integrate 3rd party stuff with Chartist.
http://jsbin.com/xojezu/edit?html,js,output
I tried it before with the object notation, but i got always errors like:
Error: Invalid value for <text> attribute dx="NaN"(anonymous function) @ chartist.js:1428e @ chartist.js:1419d @ chartist.js:1385f @ chartist.js:1115f @ chartist.js:1446e @ chartist.js:3274h @ chartist.js:1272
chartist.js:1428 Error: Invalid value for <text> attribute dy="NaN"(anonymous function) @ chartist.js:1428e @ chartist.js:1419d @ chartist.js:1385f @ chartist.js:1115f @ chartist.js:1446e @ chartist.js:3274h @ chartist.js:1272
chartist.js:1428 Error: Invalid value for <path> attribute d="M NaN NaN A 70 70 0 1 0 NaN NaN L 105 75"
I just copied your js in my project and same errors
What version of Chartist are you using?
oh i see...
i'm so sorry! the project was on hold for a while. So i didn't checked it. I will do an Update and check again. Thanks
btw. it was "version": "0.7.3"
it was the old version! Thanks
no worries! Glad it works now