Additional chart range padding with only positive values

Hi!


Is there a way to use additional chart range padding to a chart axis but only show positive values. So if the additional padding would result in a nagative minimum value, use 0 instead?


My chart axis code:

<ChartPrimaryYAxis ValueType="Syncfusion.Blazor.Charts.ValueType.Double" Span="1"  RangePadding="ChartRangePadding.Additional" Minimum="0" />

Thanks for the answer.



2 Replies

DG Durga Gopalakrishnan Syncfusion Team January 11, 2022 03:04 PM UTC

Hi Kristof,


Yes, you can use Additional RangePadding with Minimum value as 0 for chart. We have prepared sample based on your requirement. Please check with below snippet and sample.


<SfChart>

<ChartPrimaryYAxis RangePadding="ChartRangePadding.Additional" Minimum="0" >

    </ChartPrimaryYAxis>

</SfChart>



Sample : https://www.syncfusion.com/downloads/support/directtrac/general/ze/RangePadding1251091276.zip


Kindly revert us if you have any concerns.


Regards,

Durga G



KR Kristof January 11, 2022 05:10 PM UTC

Thanks for the answer, but if I use the recommended solution, the chart will always start from 0, even if all the data points are around 10000. See image.Képernyőfotó 2022-01-11 - 18.06.14.png

I'd like to use the auto values set by RangePadding="ChartRangePadding.Additional but only show positive numbers.


Loader.
Up arrow icon