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

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.

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:


Here is the script:

Thank you for any input.
Mark T.

I typically use

	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)

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.

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:

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

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

1 Like