This is a migrated thread and some comments may be shown as answers.

Bar chart vertical axis values not starting at zero

3 Answers 307 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Shawn
Top achievements
Rank 1
Shawn asked on 27 May 2014, 09:24 PM
On a Cartesian chart (bar chart,) with certain values, the vertical axis is not starting at zero. Attached are two images. One shows the values formatted by default. The other is the values formatted as an integer. Note that the chart formatted as an integer is repeating values. The repetition is the ultimate problem, but I think it is the result of another problem (the vertical axis not starting at zero) or at least they are related in some manner.

Any suggestions? 

3 Answers, 1 is accepted

Sort by
1
Accepted
Petar Marchev
Telerik team
answered on 30 May 2014, 07:24 AM
Hi Shawn,

You can simply set the Minimum of the axis to 0. This behavior is by design as the chart is trying to show a more detailed axis range for the values it presents.

Regards,
Petar Marchev
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Shawn
Top achievements
Rank 1
answered on 03 Jun 2014, 02:40 PM
I am not fond of this default behavior, but did what you said. I checked for my minimum possible value. If it was greater than or equal to zero, I set the minimum equal to zero. Otherwise, I allowed the default behavior. I could still see undesired results, but I believe they would be rare and negligible. 

Thanks for your help.
1
Petar Marchev
Telerik team
answered on 04 Jun 2014, 12:29 PM
Hi Shawn,

I am not fond of this default behavior
The chart behaves much like the excel chart, where the range is based on the values it presents. There is a notion of a delta - the delta is the difference between the max and min values. If the delta is less than six times smaller than the max - the chart includes the zero (if (max / delta < 6) IncludeZero). An exception is made when the delta is 0, which is the case you are interested in. In this case, it makes no sense to include the 0, because the value could be 10 billion. If later you add another item with value 10 billion and one, the chart will chose a range (10 bil, 10 bil + 1), so having the zero would make no sense.

This is why by default if the delta is 0, we show a range ~(+0.5, -0.5) around the value. To make sure the zero is part of the range - the proper way to go is to set the Minimum to zero, this is by design.

I could still see undesired results
If you inform us about these, we might be able to help, or if you think that there is a bug, or a better way to display the range, please let us know.

Regards,
Petar Marchev
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
ChartView
Asked by
Shawn
Top achievements
Rank 1
Answers by
Petar Marchev
Telerik team
Shawn
Top achievements
Rank 1
Share this question
or