# Pareto Chart in Vision

**URL:** <https://forum.inductiveautomation.com/t/pareto-chart-in-vision/71901>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [March 31, 2023, 1:16pm UTC](https://forum.inductiveautomation.com/t/pareto-chart-in-vision/71901 "2023-03-31T13:16:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lanutoshi\_Paul](https://avatars.discourse-cdn.com/v4/letter/l/71e660/32.png) [@Lanutoshi\_Paul](https://forum.inductiveautomation.com/u/Lanutoshi_Paul)\
**Post date:** [March 31, 2023, 1:16pm UTC](https://forum.inductiveautomation.com/t/pareto-chart-in-vision/71901/1 "2023-03-31T13:16:44Z")

</div>

I am trying to create a pareto chart for down time reason codes filtered by start date and end date.

Here is what my query outputs:

| Down\_Time\_Reason | total\_min | percent\_total |
| --- | --- | --- |
| No\_Staffing | 18995 | 33 |
| Process\_Troubleshooting | 11785 | 20 |
| Inspection | 9641 | 17 |
| Setup | 9260 | 16 |
| Operator\_PM | 4757 | 8 |
| Part\_Cleaning | 1252 | 2 |
| No\_Tools | 443 | 0 |
| No\_Parts | 46 | 0 |

I used the bar chart to output the following:

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

I would like to plot the percentages with the line as well. I cannot seem to figure out how to do this. Does anyone have any suggestions?

Thanks,  
Toshi

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [April 2, 2023, 1:46am UTC](https://forum.inductiveautomation.com/t/pareto-chart-in-vision/71901/2 "2023-04-02T01:46:47Z")

</div>

@prasath.t did something similar to what you are wanting in this post which includes a downloadable example:

> [@Change each bar width in histogram chart](https://forum.inductiveautomation.com/t/change-each-bar-width-in-histogram-chart/66847/34):
>
> @justinedwards.jle@lrose I tired using area chart instead of bar chart. width of the bar is adjusting ok now but line chart showing one hour difference from the actula time I have attached my project file for your reference can you please correct which place i am doing worng [BarWidth.zip](https://forum.inductiveautomation.com/uploads/short-url/9BHIfZy4u0HxPkl7PmrZtkElG5N.zip) (16.1 KB)

Perhaps you can adapt his work to your usage case.

Another, perhaps simpler option would be to overlay a standard chart over the bar chart and set the Background Color and Plot Background color to transparent. You would also probably want to set Show Legend and Show Popup properties to false.

Doing a quick experiment for proof of concept purposes, I was able to eliminate the rest of the chart's axis features by applying the following script to the configureChart extension function:

```auto
#def configureChart(self, chart):
	
	domainAxis = chart.plot.domainAxis
	rangeAxis = chart.plot.rangeAxis
	
	domainAxis.setTickLabelsVisible(False)
	domainAxis.setAxisLineVisible(False)
	domainAxis.setTickMarksVisible(False)
	domainAxis.label = ''
		
	rangeAxis.setTickLabelsVisible(False)
	rangeAxis.setAxisLineVisible(False)
	rangeAxis.setTickMarksVisible(False)
	rangeAxis.label = ''

```

**This was the result:**

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/9/d9c75cdb85f9ab0511d23ee2392275dfcc43dd7d.png)

---

<div class="post-metadata">

**Author:** ![Lanutoshi\_Paul](https://avatars.discourse-cdn.com/v4/letter/l/71e660/32.png) [@Lanutoshi\_Paul](https://forum.inductiveautomation.com/u/Lanutoshi_Paul)\
**Post date:** [April 3, 2023, 12:07pm UTC](https://forum.inductiveautomation.com/t/pareto-chart-in-vision/71901/3 "2023-04-03T12:07:28Z")

</div>

Thank you! It worked!

---

<div class="post-metadata">

**Author:** ![Lanutoshi\_Paul](https://avatars.discourse-cdn.com/v4/letter/l/71e660/32.png) [@Lanutoshi\_Paul](https://forum.inductiveautomation.com/u/Lanutoshi_Paul)\
**Post date:** [April 3, 2023, 2:37pm UTC](https://forum.inductiveautomation.com/t/pareto-chart-in-vision/71901/4 "2023-04-03T14:37:26Z")

</div>

I am using a popup calendar to filter dates by which the line and bar chart are populated. On selecting certain dates/time I get the following error:

 ![error](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/4/0409b3c3cb90b14dcdd938af72555ee835ae335e.png)

Would you know what caused this @justinedwards.jle ?

Thanks,  
Toshi

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [April 4, 2023, 12:49am UTC](https://forum.inductiveautomation.com/t/pareto-chart-in-vision/71901/5 "2023-04-04T00:49:13Z")

</div>

It appears that the lower date range of the chart's axis is somehow being set to a date that is greater than the upper date range. It's difficult to say how this is happening without knowing more about how the information is flowing. Is it a binding? Is it a script? When does the error occur; at initialization or at date selection?

---

<div class="post-metadata">

**Author:** ![Lanutoshi\_Paul](https://avatars.discourse-cdn.com/v4/letter/l/71e660/32.png) [@Lanutoshi\_Paul](https://forum.inductiveautomation.com/u/Lanutoshi_Paul)\
**Post date:** [April 4, 2023, 5:10pm UTC](https://forum.inductiveautomation.com/t/pareto-chart-in-vision/71901/6 "2023-04-04T17:10:36Z")

</div>

You are correct. The error only pops up when the dates are not in the right format(date selection). I am using a binding.
