# Jfree chart - click on rendered data point

**URL:** <https://forum.inductiveautomation.com/t/jfree-chart-click-on-rendered-data-point/38066>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [August 25, 2020, 6:29pm UTC](https://forum.inductiveautomation.com/t/jfree-chart-click-on-rendered-data-point/38066 "2020-08-25T18:29:20Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [August 31, 2020, 3:23pm UTC](https://forum.inductiveautomation.com/t/jfree-chart-click-on-rendered-data-point/38066/12 "2020-08-31T15:23:11Z")

</div>

This should do the trick:

```auto
from org.jfree.chart import ChartMouseListener

class CustomChartMouseListener(ChartMouseListener):
     def chartMouseClicked(self,e):
          xyItem = e.getEntity() #gets the data entity that was clicked, None if no entity was clicked
          if xyItem: #ensure that a data entity was clicked
               dataset = xyItem.getDataset()
               xValue = dataset.getXValue(xyItem.getSeriesIndex(),xyItem.getItem())
               yValue = dataset.getYValue(xyItem.getSeriesIndex(),xyItem.getItem())

               system.nav.openWindow('YourPopupWindowClass',{'yValueParameterName':xValue,'yValueParameterName':yValue})

for listener in self.getListeners(ChartMouseListener):
     self.removeChartMouseListener(listener)

self.addChartMouseListener(CustomChartMouseListener())

```

---

_[View the full topic](https://forum.inductiveautomation.com/t/jfree-chart-click-on-rendered-data-point/38066)._
