# Pie chart labels

**URL:** <https://forum.inductiveautomation.com/t/pie-chart-labels/37259>\
**Category:** Ignition\
**Tags:** ignition79, vision\
**Created:** [July 31, 2020, 2:18pm UTC](https://forum.inductiveautomation.com/t/pie-chart-labels/37259 "2020-07-31T14:18:59Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [July 16, 2021, 6:32pm UTC](https://forum.inductiveautomation.com/t/pie-chart-labels/37259/7 "2021-07-16T18:32:26Z")

</div>

```auto
	from org.jfree.chart.labels import StandardPieSectionLabelGenerator
	
	class LabelGenerator(StandardPieSectionLabelGenerator):
		def __init__ (self, component):
			self.component = component
			StandardPieSectionLabelGenerator. __init__ (self, "")
			
		def generateSectionLabel(self, dataset, key):
			defaultValues = self.createItemArray(dataset, key)
			return "{0}: {1} ({2})".format(
				key,
				self.component.data.getValueAt(dataset.getIndex(key), 1),
				defaultValues[2]
			)
	chart.plot.labelGenerator = LabelGenerator(self)

```

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/2/b2d9bef23d346782021921bcba4a5bfa8e32bf6c.png)

---

_[View the full topic](https://forum.inductiveautomation.com/t/pie-chart-labels/37259)._
