Display Label on Each point of an XYChart

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:

I know how to display the value for each point:

from org.jfree.chart.labels import StandardXYItemLabelGenerator


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

You’ll need to create a jython class that extends StandardXYItemLabelGenerator and implements your desired logic in its generateLabel() method. Something like this:

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

Thank you!!! :blush:
Next step will be to increase the label’s font :muscle: