# Selecting data from a report query for a marker in a chart

**URL:** <https://forum.inductiveautomation.com/t/selecting-data-from-a-report-query-for-a-marker-in-a-chart/101975>\
**Category:** Ignition\
**Created:** [February 6, 2025, 2:16pm UTC](https://forum.inductiveautomation.com/t/selecting-data-from-a-report-query-for-a-marker-in-a-chart/101975 "2025-02-06T14:16:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robert\_Thompson](https://avatars.discourse-cdn.com/v4/letter/r/edb3f5/32.png) [@Robert\_Thompson](https://forum.inductiveautomation.com/u/Robert_Thompson)\
**Post date:** [February 6, 2025, 2:16pm UTC](https://forum.inductiveautomation.com/t/selecting-data-from-a-report-query-for-a-marker-in-a-chart/101975/1 "2025-02-06T14:16:57Z")

</div>

Greetings! I have a report where the query is broken down into steps, several for each report. I have a set point that is generated for each step, and I would like to add a marker to the graph for the step, in this case we are monitoring temperature and the set point is temperature.

I can add the marker using a static number and I get a line and label like I want. I have so far not been able to parse the data from the query to dynamically add the value for the set point.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/b/abf58fe6ab9665ae7f4bfd013929b39e9a9151ff.png)

This is step 1, the set point happens to be 0.0 here and we don't watch set point for control, but the value on line 6836 shows the TempSP. I currently have float(data['TempSP']), but the chart script stops when I enter that line and I do not have a marker line on the chart. I've used different variations of the data, full query text, etc. and so far no value. I'm not sure what I'm doing wrong, but I'm sure it is simple when I see what it is supposed to be. This value shows up in the Key Browser:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/b/6b7c7ecdc87c736d149201a3f12e2338e9f47a3e.png)  
Here is the script:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/d/1dd9aa33f676cad2524c5f3c97e5e4ed0b9bc181.png)

Thank you for any input.  
Mark T.

---

<div class="post-metadata">

**Author:** ![MMaynard](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmaynard/32/3366_2.png) [@MMaynard](https://forum.inductiveautomation.com/u/MMaynard)\
**Post date:** [February 6, 2025, 3:00pm UTC](https://forum.inductiveautomation.com/t/selecting-data-from-a-report-query-for-a-marker-in-a-chart/101975/2 "2025-02-06T15:00:29Z")

</div>

I typically use

```python
	from org.jfree.chart.plot import ValueMarker
	from java.awt import Color, BasicStroke
	goal = 60.0
	stroke = BasicStroke(1.5)
	marker = ValueMarker(goal, Color(125,125,125,255),stroke)
	chart.getPlot().addRangeMarker(marker)

```

---

<div class="post-metadata">

**Author:** ![Robert\_Thompson](https://avatars.discourse-cdn.com/v4/letter/r/edb3f5/32.png) [@Robert\_Thompson](https://forum.inductiveautomation.com/u/Robert_Thompson)\
**Post date:** [February 6, 2025, 3:16pm UTC](https://forum.inductiveautomation.com/t/selecting-data-from-a-report-query-for-a-marker-in-a-chart/101975/3 "2025-02-06T15:16:42Z")

</div>

Yes, that would work if my goal was fixed, I want a dynamic goal based on the step set point for the temperature and I don't know how to find the value.

Thank you for the response, good input.

---

<div class="post-metadata">

**Author:** ![MMaynard](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmaynard/32/3366_2.png) [@MMaynard](https://forum.inductiveautomation.com/u/MMaynard)\
**Post date:** [February 6, 2025, 4:11pm UTC](https://forum.inductiveautomation.com/t/selecting-data-from-a-report-query-for-a-marker-in-a-chart/101975/4 "2025-02-06T16:11:27Z")

</div>

Oh dear Lord.. I thought it just wasn't showing.  
Only way I can think of to access a sub query data is to create a script datasource on the report, then assign the value to it from the sub query.  
Something like  
Script Datasource:

```python
getNested = data['CIP_Record'].getNestedQueryResults()
data['nestedStep'] = getNested['steps'][0]

```

Then in the script on the chart  
`v = data['nestedStep'].getValueAt(0,0)`
