# Dynamic label for a time-series chart in the report

**URL:** <https://forum.inductiveautomation.com/t/dynamic-label-for-a-time-series-chart-in-the-report/14090>\
**Category:** Ignition\
**Created:** [April 20, 2017, 10:12am UTC](https://forum.inductiveautomation.com/t/dynamic-label-for-a-time-series-chart-in-the-report/14090 "2017-04-20T10:12:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrea.minu](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/andrea.minu/32/3326_2.png) [@andrea.minu](https://forum.inductiveautomation.com/u/andrea.minu)\
**Post date:** [April 20, 2017, 10:12am UTC](https://forum.inductiveautomation.com/t/dynamic-label-for-a-time-series-chart-in-the-report/14090/1 "2017-04-20T10:12:38Z")

</div>

Hi Everybody

I need create a report with a time-series chart , with dynamic history pens.  
I created a parameter for to pass coreectly the name of the pen , but I don’t find the right syntax to create the dynamic label for the pen.

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/c/cec0a01cb38a3607c7f06274af0b9f98286f1e6a.PNG)

which is the right syntax to put in the Pen Name parameter?

![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/9/9f443c36f50b423eaacc4b01d7b62f545252edd0.PNG) ( see picture below)

Thank you very much

Andrea

---

<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:** [April 20, 2017, 3:25pm UTC](https://forum.inductiveautomation.com/t/dynamic-label-for-a-time-series-chart-in-the-report/14090/2 "2017-04-20T15:25:30Z")

</div>

There isn’t a way to dynamically label the pens in a report, but it is possible using the configureChart extension function. Here’s a small example showing how to extend the JFreeChart objects:

```auto
	from org.jfree.chart.labels import StandardXYSeriesLabelGenerator
	plot = chart.getPlot()
	renderer = plot.getRenderer()
	
	class customLabelGenerator(StandardXYSeriesLabelGenerator):
		def __init__ (self):
			self.count = 0
		def generateLabel(self, dataset, series):
			self.count += 1
			return 'Test %s' % self.count
	
	renderer.setLegendItemLabelGenerator(customLabelGenerator())

```
