# Power Chart adjusting the Y axis to accommodate your data range

**URL:** <https://forum.inductiveautomation.com/t/power-chart-adjusting-the-y-axis-to-accommodate-your-data-range/92977>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [July 9, 2024, 8:06pm UTC](https://forum.inductiveautomation.com/t/power-chart-adjusting-the-y-axis-to-accommodate-your-data-range/92977 "2024-07-09T20:06:31Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Myasrama](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/myasrama/32/63822_2.png) [@Myasrama](https://forum.inductiveautomation.com/u/Myasrama)\
**Post date:** [July 9, 2024, 8:06pm UTC](https://forum.inductiveautomation.com/t/power-chart-adjusting-the-y-axis-to-accommodate-your-data-range/92977/1 "2024-07-09T20:06:31Z")

</div>

I am having an issue with my power chart component in perspective. I have a data set ranging from (1 \* 10^-9 - to about 800). This range of values is displayed on the image shown.

As you can see the very small values are displaying within my ideal range (the green rectangle). However those red straight lines going up are linked to values such as 100-800 on the y axis.

Is there a way to to better format the scaling of the y axis? Do I have to do some data processing?

I have tried to adjust the min, max, tick count values it seems the scaling is off and the component doesn't display the expected behavior.

Also, if you noticed I started my min value as negative because the data wouldn't show other wise.

Thank You

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

---

<div class="post-metadata">

**Author:** ![drojas](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/drojas/32/3403_2.png) [@drojas](https://forum.inductiveautomation.com/u/drojas)\
**Post date:** [July 9, 2024, 9:30pm UTC](https://forum.inductiveautomation.com/t/power-chart-adjusting-the-y-axis-to-accommodate-your-data-range/92977/2 "2024-07-09T21:30:56Z")

</div>

Are those values that shoot above 0.1 valid...or just noise in your data? If noise, then you need to loop through your data and filter (set to None) those data points that exceed some arbitrary threshold. The None will cause gaps in the line, but you will know that it was invalid data.

---

<div class="post-metadata">

**Author:** ![Myasrama](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/myasrama/32/63822_2.png) [@Myasrama](https://forum.inductiveautomation.com/u/Myasrama)\
**Post date:** [July 10, 2024, 11:53am UTC](https://forum.inductiveautomation.com/t/power-chart-adjusting-the-y-axis-to-accommodate-your-data-range/92977/3 "2024-07-10T11:53:16Z")

</div>

Yes, they are valid datasets, the true expected range is the one mentioned before.

I was thinking maybe the range is too large and maybe I need to find a better way to display this. Example, cleaning the data and displaying the high values somewhere else.

---

<div class="post-metadata">

**Author:** ![Felipe\_CRM](https://avatars.discourse-cdn.com/v4/letter/f/dfb087/32.png) [@Felipe\_CRM](https://forum.inductiveautomation.com/u/Felipe_CRM)\
**Post date:** [July 10, 2024, 12:53pm UTC](https://forum.inductiveautomation.com/t/power-chart-adjusting-the-y-axis-to-accommodate-your-data-range/92977/4 "2024-07-10T12:53:47Z")

</div>

Try a logarithmic scale:

> **[Perspective - XY Chart | Ignition User Manual](https://docs.inductiveautomation.com/docs/8.1/appendix/components/perspective-components/perspective-chart-palette/perspective-xy-chart#yaxesvalue)**
>
> The XY Chart displays data trends.

It would accomodate both your large and small values, as long as you're careful setting the range:

> [@Help setting up the y axis scaling on a Perspective XY Chart](https://forum.inductiveautomation.com/t/help-setting-up-the-y-axis-scaling-on-a-perspective-xy-chart/87068/2):
>
> On the logarithmic scale, the issue is with your range. Since the log of 0 explodes to negative infinity, the chart will attempt to max out the range and your values will disappear. [image] [image] Instead, set the min to a reasonable low value, or leave it blank so the chart will automatically set a lower limit based on the data (you can still specify a max): [image] [image] For the linear chart, you'll have to play with the appearance.grid.minDistance property of your axis: [image] [im…

---

<div class="post-metadata">

**Author:** ![Myasrama](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/myasrama/32/63822_2.png) [@Myasrama](https://forum.inductiveautomation.com/u/Myasrama)\
**Post date:** [July 10, 2024, 5:54pm UTC](https://forum.inductiveautomation.com/t/power-chart-adjusting-the-y-axis-to-accommodate-your-data-range/92977/5 "2024-07-10T17:54:17Z")

</div>

I am using the power chart, I don't think there is an option for log scale. I believe the XY chart has that option.

---

<div class="post-metadata">

**Author:** ![Felipe\_CRM](https://avatars.discourse-cdn.com/v4/letter/f/dfb087/32.png) [@Felipe\_CRM](https://forum.inductiveautomation.com/u/Felipe_CRM)\
**Post date:** [July 10, 2024, 6:15pm UTC](https://forum.inductiveautomation.com/t/power-chart-adjusting-the-y-axis-to-accommodate-your-data-range/92977/6 "2024-07-10T18:15:17Z")

</div>

> [@Myasrama](#):
>
> power chart

I believe you're correct. I suppose you could log transform your data in a separate tag to be able to use the power chart, but then your axes labels would be off.

Personally, I switched over to the XY chart because of little issues like this, although it means a lot of reinventing the wheel there's also a lot more control.

---

<div class="post-metadata">

**Author:** ![Myasrama](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/myasrama/32/63822_2.png) [@Myasrama](https://forum.inductiveautomation.com/u/Myasrama)\
**Post date:** [July 10, 2024, 8:32pm UTC](https://forum.inductiveautomation.com/t/power-chart-adjusting-the-y-axis-to-accommodate-your-data-range/92977/7 "2024-07-10T20:32:57Z")

</div>

Is it possible to convert the values in the power chart to log using jython?

---

<div class="post-metadata">

**Author:** ![Felipe\_CRM](https://avatars.discourse-cdn.com/v4/letter/f/dfb087/32.png) [@Felipe\_CRM](https://forum.inductiveautomation.com/u/Felipe_CRM)\
**Post date:** [July 10, 2024, 8:47pm UTC](https://forum.inductiveautomation.com/t/power-chart-adjusting-the-y-axis-to-accommodate-your-data-range/92977/8 "2024-07-10T20:47:10Z")

</div>

Not as such, the powerchart only lets you grab historical tags with no way to change that data (besides the built-in aggregation modes) as far as I know.

The best you could do with a powerchart would be to create a derived tag with your desired transformation and historize _that_ but you'll agree it's kind of a terrible hack.

---

<div class="post-metadata">

**Author:** ![Myasrama](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/myasrama/32/63822_2.png) [@Myasrama](https://forum.inductiveautomation.com/u/Myasrama)\
**Post date:** [July 11, 2024, 5:32pm UTC](https://forum.inductiveautomation.com/t/power-chart-adjusting-the-y-axis-to-accommodate-your-data-range/92977/9 "2024-07-11T17:32:57Z")

</div>

Yes, it seems it would cause performance issues.

In my database I managed to convert my values into a log scale before they are served into the ignition component and it seems to display the data better.

So now on my y axis the data shows better and is scaled well in the power chart component. (see attached image)

I do want to represent the actually values and not their log equivalents, is there some sort of conversion that is possible, or maybe secondary axis.

I am thinking if I do attempt any of this I will end up back at square one with the same issue.

thoughts?

Thanks

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/a/ca5aa4b5d40e80e129f8e2b1a289dea7c58c4d4e.png)

---

<div class="post-metadata">

**Author:** ![Myasrama](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/myasrama/32/63822_2.png) [@Myasrama](https://forum.inductiveautomation.com/u/Myasrama)\
**Post date:** [July 15, 2024, 11:34am UTC](https://forum.inductiveautomation.com/t/power-chart-adjusting-the-y-axis-to-accommodate-your-data-range/92977/10 "2024-07-15T11:34:30Z")

</div>

Just wanted to share a solution which is to convert your data into a log scale in your DB. Then use the marker tool in plot, to plot several points on your log scale but have them represent your non log scale values, so the data has meaning .

---

<div class="post-metadata">

**Author:** ![Felipe\_CRM](https://avatars.discourse-cdn.com/v4/letter/f/dfb087/32.png) [@Felipe\_CRM](https://forum.inductiveautomation.com/u/Felipe_CRM)\
**Post date:** [July 15, 2024, 12:46pm UTC](https://forum.inductiveautomation.com/t/power-chart-adjusting-the-y-axis-to-accommodate-your-data-range/92977/11 "2024-07-15T12:46:15Z")

</div>

I hope IA adds more functionality to the power chart down the line so we don't have to resort to these kind of workarounds.

Related feature request that would make the workaround easier:

> **[Easy Chart or Power Chart - Virtual Pens | Ignition Features and Ideas |...](https://inductiveautomation.canny.io/ignition-features-and-ideas/p/easy-chart-or-power-chart-virtual-pens)**
>
> Virtual pens would allow a user to create ad hoc expressions/calculations based on existing tags that are in the trend only.

EDIT: Changed link, the one I had linked before was easy chart, not power chart. Idea is similar.

However, it's probably best to just have the ability to choose a log axis like for XY charts. I couldn't find a feature request for it so you might want to submit one for it.
