Vision Chart: Interpolation and visual bands

Hi Everyone,

Given below is my Chart, in Vision. It displays a forecast of what the value of a certain Variable will be, in half hour intervals, the next 7 days. Just like a 7 days' temperature forecast.
image

Even though we see some slopes, the actual value changes are very much discreet/step like. A typical forecast would be something like: 0, 20, 20, 0, -20, -40, -60, -60, -20-, 0, etc......... Is there a way to make the chart steplike?

And also, I would like to create bands, like so:


How can I do this?

Any guidance will be very much appreciated. Thank you.

Just for clarification, this is a Chart and not an Easy Chart?

Hi Justin. Yup, this is a Chart. I haven't tried the Easy Chart yet.

• Right click on the chart and select: "Chart Customizer"
• Switch to the "Dataset Properties" tab, select the dataset, and change the renderer to "XY Step Renderer"
image

Use interval markers for this purpose.
Example:

# configureChart Extension Function
#def configureChart(self, chart):
	# Import interval marker class
	from org.jfree.chart.plot import IntervalMarker
	
	# Range 0 to 12 earth green
	chart.plot.addRangeMarker(IntervalMarker(0, 12, system.gui.color(56, 94, 15, 80)))
	
	# Range 12 to 24 teal
	chart.plot.addRangeMarker(IntervalMarker(12, 24, system.gui.color(0, 128, 128, 80)))
	
	# Range 24 to 36 light blue
	chart.plot.addRangeMarker(IntervalMarker(24, 36, system.gui.color(173, 216, 230, 140)))
	
	# Range 36 to 48 light grey
	chart.plot.addRangeMarker(IntervalMarker(36, 48, system.gui.color(128, 128, 128, 80)))
	
	# Range 48 to 60 peach
	chart.plot.addRangeMarker(IntervalMarker(48, 60, system.gui.color(255, 218, 185, 80)))
	
	# Range 60 to 72 light orange
	chart.plot.addRangeMarker(IntervalMarker(60, 72, system.gui.color(255, 179, 74, 80)))

	# Range 72 to 96 light red
	chart.plot.addRangeMarker(IntervalMarker(72, 96, system.gui.color(255, 99, 74, 80)))

Result:

6 Likes

Hi Justin,

Thank you so much. Everything worked so well! This saved me so much time.

I will buy you a beer or two!!! :smiley: Cheers.

1 Like