Chartist-js: Pie Chart Tooltip

Created on 16 Jun 2015  路  6Comments  路  Source: gionkunz/chartist-js

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

question

All 6 comments

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

eddr picture eddr  路  3Comments

andreasba picture andreasba  路  3Comments

unhinged picture unhinged  路  3Comments

alberk8 picture alberk8  路  4Comments

LandonSchropp picture LandonSchropp  路  3Comments