Using the Chart Config Editor to customise tooltips for pie charts

I am using the Chart Config Editor to customise tooltips for a pie chart. Currently, my tooltip includes the following information:

  • a circle, which is rendered the same colour as the segment colour
  • the value of the segment (e.g. 267,023)
  • the percentage share of the segment (e.g. 32%)

 

 

tooltip: {
format: '<span style="color:{color}">\u25CF</span> {key}<br/>{y:,.0f} ({percentage:,.0f}%)',
},

 

I also want to include the name of the measure (e.g. 'Items Sold'). I don't want to hard-code this by just typing 'items sold' into the format property. For cartesian charts, I would just include the variable {series.name}. However, for pie charts, this variable generates the text 'Series 1' for every segment. How do I reference the series name for pie charts?

(In case this is helpful to anyone else, here are the variables that I have documented so far:)

 
 
variables.png
1 1 34
1 REPLY 1

Interesting! In my tests, this works just fine for pie charts. And it seems like "series.name" should be the right variable to use. Can you try adding the "log" variable to inspect the value of that variable? Like in the screenshot here:

sam8_0-1747158228021.png

I'm wondering if somewhere the series name got hard-coded to a value like "Series 1".

Top Labels in this Space
Top Solution Authors