# Display Label on Each point of an XYChart

**URL:** <https://forum.inductiveautomation.com/t/display-label-on-each-point-of-an-xychart/23159>\
**Category:** Ignition\
**Tags:** ignition79\
**Created:** [March 8, 2019, 1:33pm UTC](https://forum.inductiveautomation.com/t/display-label-on-each-point-of-an-xychart/23159 "2019-03-08T13:33:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![c.bertulli](https://avatars.discourse-cdn.com/v4/letter/c/f19dbf/32.png) [@c.bertulli](https://forum.inductiveautomation.com/u/c.bertulli)\
**Post date:** [March 8, 2019, 1:33pm UTC](https://forum.inductiveautomation.com/t/display-label-on-each-point-of-an-xychart/23159/1 "2019-03-08T13:33:46Z")

</div>

Hi All,

As the title says, I would like to have a label on top of each XYChart’s point.  
The final goal is shown in the picture below:

 ![Immagine](https://us1.discourse-cdn.com/inductiveautomation/original/2X/2/26c34f24f8df0a97e26ea54dd266a052066db44e.png)

I know how to display the value for each point:

```auto
from org.jfree.chart.labels import StandardXYItemLabelGenerator

chart.getPlot().getRenderer().setItemLabelGenerator(StandardXYItemLabelGenerator())
chart.getPlot().getRenderer().setBaseItemLabelsVisible(True)

```

But I can’t find a way to display a custom label.  
Can someone share some Java magic?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 8, 2019, 2:03pm UTC](https://forum.inductiveautomation.com/t/display-label-on-each-point-of-an-xychart/23159/2 "2019-03-08T14:03:10Z")

</div>

You’ll need to create a jython class that extends [StandardXYItemLabelGenerator](http://www.jfree.org/jfreechart/api/gjdoc/org/jfree/chart/labels/StandardXYItemLabelGenerator.html) and implements your desired logic in its generateLabel() method. Something like this:

```auto
from org.jfree.chart.labels import StandardXYItemLabelGenerator

class MyLabelGenerator(StandardXYItemLabelGenerator):
	def generateLabel(self, xyds, series, item):
		return "s%dp%d" % (series, item)

renderer = chart.plot.renderer
renderer.setItemLabelGenerator(MyLabelGenerator())
renderer.setBaseItemLabelsVisible(True)

```

---

<div class="post-metadata">

**Author:** ![c.bertulli](https://avatars.discourse-cdn.com/v4/letter/c/f19dbf/32.png) [@c.bertulli](https://forum.inductiveautomation.com/u/c.bertulli)\
**Post date:** [March 8, 2019, 4:08pm UTC](https://forum.inductiveautomation.com/t/display-label-on-each-point-of-an-xychart/23159/3 "2019-03-08T16:08:42Z")

</div>

Thank you!!! 😊  
Next step will be to increase the label’s font 💪
