# Adding Y-Axis value label to an easy chart?

**URL:** <https://forum.inductiveautomation.com/t/adding-y-axis-value-label-to-an-easy-chart/16366>\
**Category:** Ignition\
**Created:** [December 19, 2017, 5:41pm UTC](https://forum.inductiveautomation.com/t/adding-y-axis-value-label-to-an-easy-chart/16366 "2017-12-19T17:41:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![brian.mcenulty](https://avatars.discourse-cdn.com/v4/letter/b/b77776/32.png) [@brian.mcenulty](https://forum.inductiveautomation.com/u/brian.mcenulty)\
**Post date:** [December 19, 2017, 5:41pm UTC](https://forum.inductiveautomation.com/t/adding-y-axis-value-label-to-an-easy-chart/16366/1 "2017-12-19T17:41:42Z")

</div>

I have an easy chart component that has a pen with a constant target value that I’d like to add a Y-Axis label to with the current numeric value of the pen. Ideally the label is the same color as the pen itself and next to the line. Is there any easy way to add such a label using any of the JFreeChart methods? I’ve looked and I’m not sure which JFreeChart methods would allow me to do this.

Here’s a screenshot of the trend. The green line is the constant value pen with a value of 20%. I’d like to have a label, in the same green color as the pen, on the Y-Axis that says “20” in the same font as the Y-Axis labels.  
 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/c/cac340cc248e3f004e415e03ccdea450fff266be.png)

---

<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:** [December 19, 2017, 9:38pm UTC](https://forum.inductiveautomation.com/t/adding-y-axis-value-label-to-an-easy-chart/16366/2 "2017-12-19T21:38:13Z")

</div>

You’ll need to a [ValueMarker](http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/plot/ValueMarker.html), which can be added to the Plot ([`chart.getPlot()`](http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/JFreeChart.html#getPlot--)) with [`plot.addRangeMarker(valuemarker)`](http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/plot/XYPlot.html#addRangeMarker-int-org.jfree.chart.plot.Marker-org.jfree.chart.ui.Layer-)

---

<div class="post-metadata">

**Author:** ![ghuck](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ghuck/32/8337_2.png) [@ghuck](https://forum.inductiveautomation.com/u/ghuck)\
**Post date:** [December 19, 2017, 10:19pm UTC](https://forum.inductiveautomation.com/t/adding-y-axis-value-label-to-an-easy-chart/16366/3 "2017-12-19T22:19:12Z")

</div>

Why not just create a Calculated pen with the easy chart customizer and set it to a constant.

---

<div class="post-metadata">

**Author:** ![brian.mcenulty](https://avatars.discourse-cdn.com/v4/letter/b/b77776/32.png) [@brian.mcenulty](https://forum.inductiveautomation.com/u/brian.mcenulty)\
**Post date:** [December 19, 2017, 10:29pm UTC](https://forum.inductiveautomation.com/t/adding-y-axis-value-label-to-an-easy-chart/16366/4 "2017-12-19T22:29:45Z")

</div>

I actually am already using a calculated pen with a constant value to create the line itself, what I’m trying to do is to add a label indicating what the value of that line is to the Y-Axis.
