# Bar chart, selecting a specific bar

**URL:** <https://forum.inductiveautomation.com/t/bar-chart-selecting-a-specific-bar/17891>\
**Category:** Ignition\
**Created:** [May 1, 2018, 8:59pm UTC](https://forum.inductiveautomation.com/t/bar-chart-selecting-a-specific-bar/17891 "2018-05-01T20:59:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rigoberto.reyes](https://avatars.discourse-cdn.com/v4/letter/r/65b543/32.png) [@rigoberto.reyes](https://forum.inductiveautomation.com/u/rigoberto.reyes)\
**Post date:** [May 1, 2018, 8:59pm UTC](https://forum.inductiveautomation.com/t/bar-chart-selecting-a-specific-bar/17891/1 "2018-05-01T20:59:20Z")

</div>

Hi there.

Does anybody knows how to select a specific bar in a “bar chart” component?. I need to display a pop-up window once the bar be selected by mouse. The vertical axis means the finish good, so when user selects that bar, I would show a report related to that product.

---

<div class="post-metadata">

**Author:** ![plarochelle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/plarochelle/32/29608_2.png) [@plarochelle](https://forum.inductiveautomation.com/u/plarochelle)\
**Post date:** [May 2, 2018, 2:03pm UTC](https://forum.inductiveautomation.com/t/bar-chart-selecting-a-specific-bar/17891/2 "2018-05-02T14:03:43Z")

</div>

Hi Roberto,

Here is an example which we’ve used to drill down on a bar chart utilizing classes from the jfee chart - simply paste it in a mousePressed event script on the chart. In the chartMouseClicked method the columnKey and data can be used to pass to a report. Details on the chart object can be found at [http://www.jfree.org/index.html](http://www.jfree.org/index.html).

```auto
# import mouse listener
from org.jfree.chart import ChartMouseListener
# define mouse listener class
class myChartMouseListener(ChartMouseListener):
	# mouse moved method
	def chartMouseMoved(self, cme):
		pass
	
	# mouse clicked method
	def chartMouseClicked(self, cme):
		# get clicked information
		chartEntity = cme.getEntity()
		# if clicked on data
		if chartEntity is not None:
			columnKey = chartEntity.getColumnKey()
			data = chartEntity.getDataset()
		# close mouse listener
		chart = event.source
		chart.removeChartMouseListener(self)
# get source of event
chart = event.source
# invoke mouse listener
chart.addChartMouseListener(myChartMouseListener())

```

---

<div class="post-metadata">

**Author:** ![Nikhil.Sawalakhe](https://avatars.discourse-cdn.com/v4/letter/n/cc9497/32.png) [@Nikhil.Sawalakhe](https://forum.inductiveautomation.com/u/Nikhil.Sawalakhe)\
**Post date:** [January 5, 2021, 5:47am UTC](https://forum.inductiveautomation.com/t/bar-chart-selecting-a-specific-bar/17891/3 "2021-01-05T05:47:00Z")

</div>

Can you please help me how we can use it to get bar chart on specific bar selection. i didnt see any MouseClicked event on XY chart in ignition perspective.
