# How do I get just displayed label Value({0}) on the Pie chart?

**URL:** <https://forum.inductiveautomation.com/t/how-do-i-get-just-displayed-label-value-0-on-the-pie-chart/75349>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [June 21, 2023, 4:19pm UTC](https://forum.inductiveautomation.com/t/how-do-i-get-just-displayed-label-value-0-on-the-pie-chart/75349 "2023-06-21T16:19:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ayhan\_Yildirim](https://avatars.discourse-cdn.com/v4/letter/a/e8c25b/32.png) [@Ayhan\_Yildirim](https://forum.inductiveautomation.com/u/Ayhan_Yildirim)\
**Post date:** [June 21, 2023, 4:19pm UTC](https://forum.inductiveautomation.com/t/how-do-i-get-just-displayed-label-value-0-on-the-pie-chart/75349/1 "2023-06-21T16:19:05Z")

</div>

![grafik](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/d/ed0165310ae659c32a2167da05e40564f26cbf3a.jpeg)

displayed label({0}) name would like to use in a SQL query!

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [June 21, 2023, 6:48pm UTC](https://forum.inductiveautomation.com/t/how-do-i-get-just-displayed-label-value-0-on-the-pie-chart/75349/2 "2023-06-21T18:48:58Z")

</div>

Trying to clarify your question:

This is Vision? You are wanting to run a sql query any time the tool tip becomes visible using the first value in it?

---

<div class="post-metadata">

**Author:** ![Ayhan\_Yildirim](https://avatars.discourse-cdn.com/v4/letter/a/e8c25b/32.png) [@Ayhan\_Yildirim](https://forum.inductiveautomation.com/u/Ayhan_Yildirim)\
**Post date:** [June 22, 2023, 7:17am UTC](https://forum.inductiveautomation.com/t/how-do-i-get-just-displayed-label-value-0-on-the-pie-chart/75349/3 "2023-06-22T07:17:42Z")

</div>

It is in Vision!  
if I go with the mouse on pie chart on it, after a second one gets the name (label{0}) !in my example "RRC" It is a shortened machine name!I want to use this value(RRC) with other chart for SQL query to filter!  
The Name(label{0}) changes where mouse is located!

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [June 22, 2023, 9:00pm UTC](https://forum.inductiveautomation.com/t/how-do-i-get-just-displayed-label-value-0-on-the-pie-chart/75349/4 "2023-06-22T21:00:32Z")

</div>

This script gets the value you are looking for from the mouseMoved event handler:

```auto
from org.jfree.chart.entity import PieSectionEntity
entity = event.source.getEntityForPoint(event.x, event.y)
if isinstance(entity, PieSectionEntity):
	value = entity.sectionKey
else:
	value = ''
	
#for illustration purposes only:
event.source.parent.getComponent('TooltipCatagoryLabel').text = 'Mousover Text = ' + value

```

**Result:**  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/7/37db8c8f07312746362b7e76950c184a1abb08cb.png)

---

<div class="post-metadata">

**Author:** ![Ayhan\_Yildirim](https://avatars.discourse-cdn.com/v4/letter/a/e8c25b/32.png) [@Ayhan\_Yildirim](https://forum.inductiveautomation.com/u/Ayhan_Yildirim)\
**Post date:** [July 3, 2023, 8:25am UTC](https://forum.inductiveautomation.com/t/how-do-i-get-just-displayed-label-value-0-on-the-pie-chart/75349/5 "2023-07-03T08:25:51Z")

</div>

Thank you!!!
