javascript - Add more data to series in highchart pie chart -
i want able show 'good' or 'bad' in tooltip depending on data particular each data in series.
right have following:
data: [ ['firefox', 1], ['ie', 2], ['safari', 3], ['opera', 4], ['others', 5] ]
how add member array, example:
['firefox', 1, 'good']
so reference in tooltip such as:
tooltip: { pointformat: '{series.good_or_bad}: <b>{point.percentage:.1f}%</b>' },
i using tooltip formatter
there 2 approaches it
use tooltip > formatter own validations
tooltip: { formatter : function(){ //your validations here decide or bad } }
pass addl details data point , access tool tip
pass data shown below series:[{ data: [{ name: 'firefox', y: 1, isgood: 'good' }] }]
access tooltip shown below
tooltip:{ formatter: function() { this.point.options.isgood } }
hope 1 of these approaches give solution you
Comments
Post a Comment