# Vision Chart Deviation Render/Envelope Curve Monitoring

**URL:** <https://forum.inductiveautomation.com/t/vision-chart-deviation-render-envelope-curve-monitoring/87737>\
**Category:** Ignition\
**Tags:** python, vision, scripting, ignition81\
**Created:** [March 22, 2024, 12:58pm UTC](https://forum.inductiveautomation.com/t/vision-chart-deviation-render-envelope-curve-monitoring/87737 "2024-03-22T12:58:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajith.josephs](https://avatars.discourse-cdn.com/v4/letter/a/8e8cbc/32.png) [@ajith.josephs](https://forum.inductiveautomation.com/u/ajith.josephs)\
**Post date:** [March 22, 2024, 12:58pm UTC](https://forum.inductiveautomation.com/t/vision-chart-deviation-render-envelope-curve-monitoring/87737/1 "2024-03-22T12:58:25Z")

</div>

Does anyone have experience creating charts like this in Vision?

![Capture](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/0/e035dbea7c9598c38e7c1d06a9f5639461c00d5a.jpeg)

 ![Capture 1](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/3/d333f8a9dd280cc5773b3f9a7bb1c546a8e4822c.jpeg)

The chart aims to visualize an envelope around a curve based on a moving average (the color filled bands around the trend is established by looking at the average of the respective data points over the last 10 trends).

Since the Vision Chart component doesn't seem to have a native way to do this, I looked at the jChart API documentation and it seems it may be possible by creating a a custom charting component.

![Capture-2](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/b/4b7ef5a3ce222f59c765b4ce9717849b37ee2f1f.png)

> **[DeviationRenderer (JFreeChart 1.5.4 API)](https://javadoc.scijava.org/JFreeChart/org/jfree/chart/renderer/xy/DeviationRenderer.html)**
>
> declaration: package: org.jfree.chart.renderer.xy, class: DeviationRenderer

Does anyone have experience with creating custom charts in Vision? I have no experience with this and no real idea how to start. Would greatly benefit from some advice on how to get started (even a sample/guide of another example to understand how custom charts can be created in vision).

Any recommendations on native vision chart component, data structure in database storage to best service this application, custom chart component creation or alternative methods to achieve a similar result or visual representation of what this type of chart shows would be greatly appreciated!

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 22, 2024, 1:08pm UTC](https://forum.inductiveautomation.com/t/vision-chart-deviation-render-envelope-curve-monitoring/87737/2 "2024-03-22T13:08:45Z")

</div>

You can probably do this without a custom component by writing an appropriate `.configureChart()` method implementation on Ignition's native Chart component (in XY mode). You would need to reprocess the time scales of your datasets to have a common starting x-value.

That `DeviationRenderer` class is present in the JFreeChart jar that is distributed with Ignition.

Some topics to study for ideas:

[https://forum.inductiveautomation.com/search?q=jfreechart%20renderer%20configureChart%20order%3Alatest](https://forum.inductiveautomation.com/search?q=jfreechart%20renderer%20configureChart%20order%3Alatest)

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 22, 2024, 1:22pm UTC](https://forum.inductiveautomation.com/t/vision-chart-deviation-render-envelope-curve-monitoring/87737/3 "2024-03-22T13:22:08Z")

</div>

Even better:

> [@Help using DeviationRenderer @ Chart](https://forum.inductiveautomation.com/t/help-using-deviationrenderer-chart/14555):
>
> Hello guys, newbie reporting in after a lot of stalking and learning here in the forums, so thanks in advance for everyone willing to help slight_smile The goal here is the following: I have a normal chart with 2 y axis where I plot two types of process information (temperature and rotation) from both a setpoint and actual (live) information, comparing the lines ‘in the same canvas’. I’d like to add a “tolerance” for the setpoints - and I could do it adding new datasets (which I think it’s no…

---

<div class="post-metadata">

**Author:** ![ajith.josephs](https://avatars.discourse-cdn.com/v4/letter/a/8e8cbc/32.png) [@ajith.josephs](https://forum.inductiveautomation.com/u/ajith.josephs)\
**Post date:** [March 25, 2024, 7:38pm UTC](https://forum.inductiveautomation.com/t/vision-chart-deviation-render-envelope-curve-monitoring/87737/4 "2024-03-25T19:38:46Z")

</div>

Hi @pturmel,

Thanks for the feedback. This was super helpful. I dug through some documentation/forum posts and tried some stuff on my end with some success. Even though some of the functionality can be applied, I cant seem to get it to work for exactly what I need which is multiple filled regions.

See below for some more details around what I tried. Any feedback on how to isolate specific lines and fill between multiple lines is essentially what I am looking for.

Trial 1:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/4/34ffc680918bbae6dc6ec42910a06f9fe2148433.png)

From the information and example codes, I was able to manipulate and shade:  
• between the two blue lines only  
• When changing the code and adding more strokes, ignition does not shade between a new set of lines.

• It identifies the strokes and can make the lines thicker and thinner as needed.  
• All data is one dataset that we are grabbing for this sample graph.

Here’s the manipulation of the code:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/f/0f00163d3b790a0dc63eaebccbc064af9e704215.png)

• I also tried to assign different strokes to a different renderer, which did not make any changes.  
• It appears that ignition only picks on the first pairing of lines to shade.

Trial 2:  
Another attempt was made by separating the data for green lines and blue lines on different named queries and using the same code, the same issue occurs again.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/0/a069153272741d738b2e91ecbf6553268db6c22c.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/5/15b3ae32f3260be104a252b5608c4f238c2a30e3.png)
