Too much space at top of Y axis

There seems to be too much space at the top of the y axis, the highest value in the chart is 12, and the axis goes up to 20. I would like it to be a max of 15 if the highest value is < 15. 


It seems to look fine for values < 10, but soon as the values go above 10, the axis goes up to 20.


I tried setting a "maximum", with if statements, which works but when you deselect the different activities- e.g. Optimised or Milki by clicking on the legend, the axis doesn't automatically resize.


Basically i just want to be able to use if statements to set a maximum on the axis, but have the ability for it to resize when I deselect certain charts e.g. Milki, B&P etc. 

Any tips?


Hi 


1 Reply

SK Sriram Kiran Senthilkumar Syncfusion Team August 30, 2021 11:17 AM UTC

Hi Chris ODonnell, 
  
Greetings from Syncfusion. We have analyzed your scenario at our end, and we would like to let you know regarding the rangePadding property of an axis available in the chart widget. Using this property, you can be able to control the range padding of an axis. In your case, we kindly request you to set the rangePadding value as ChartRangePadding.round so that the axis range (minimum and maximum value) will be rounded to nearest possible value. We have also created a simple chart sample based on your screenshot and used rangePadding feature to control the axis range and attached below for your reference. 
  
  
Please check with the attached sample and revert us if you still have further concerns. 
  
For further reference on rangePadding property, please check the user guide link below. 
  
Regards, 
Sriram Kiran 


Loader.
Up arrow icon