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

  1. use tooltip > formatter own validations

    tooltip: { formatter : function(){ //your validations here decide or bad } }

  2. 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

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -