I am trying to plot constant line in Timeseries chart on a report.
Below is the Script code I am using for Trend’s script and ValueMarker is 142.5.
How can I pass the MarkerValue from report parameters?
def configureChart(chart):
from org.jfree.ui import Layer
from org.jfree.ui import RectangleAnchor
from org.jfree.ui import TextAnchor
from org.jfree.chart.plot import ValueMarker
from java.awt import BasicStroke, Color
stroke = BasicStroke(2.0)
color = Color(255,0,0)
plot = chart.getPlot()
targetValue = ValueMarker(142.5);
targetValue.setLabelAnchor(RectangleAnchor.LEFT)
targetValue.setLabelTextAnchor(TextAnchor.CENTER_LEFT)
targetValue.setLabel("Target")
targetValue.setStroke(stroke)
targetValue.setPaint(color)
plot.addRangeMarker(targetValue, Layer.BACKGROUND)
Thanks!
Fred Zaboli