Skip to main content
10-Marble
June 29, 2016
Question

Bar chart and negative values

  • June 29, 2016
  • 4 replies
  • 3124 views

Hello!

This is my first post since I am new to Thingworx. So please excuse any "easy" questions:-)

I am doing a mashup where I want to display values from an energy meter. But the values can also be negative due to solar panel production. I want to use a bar chart for this, but it seems like the bar chart only can draw from the bottom up? I want it to draw from the centerline (eg zero) and up/down dependant of the value. That is what the area and line does. Is there any configuration I have missed?

Best regards

Ulf

4 replies

10-Marble
June 29, 2016

The label chart will display negative values if they are passed in the data. I've not changed the settings for the y axis and it scales the graph (adding negative Y as needed) to show data that it needs to display. The screen shots below show the same graph with varing quantities for the items displayed.

10-Marble
June 29, 2016

Hello and thanks!

Strange. Can it be because I had only 0 and negative values when I tested? When tested today where I have some positive values, I get the same correct behavior as you. I did a new test with only 0 and negative, and I get the following result:

LabelChart.png

As you can see it draws from the lowest value and up:-)

And here the same chart with some positive values and some negative...

10-Marble
June 29, 2016

looks like a bug to me!

If you have a good idea of the possible max and min values you can 'fix' the issue by turning off Auto scaling on the y-axis and then putting in the max and min values (looks like these can also be driven by data bindings so you could write a service to give you max and minimum)

If you did write such a service you would want your maximum to be >= 1 otherwise the bars would rise from the bottom still.

Good luck