We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Spacing above and below numeric secondary axis

Hi,

I am graphing a dataset over time, with each data point having values of 1, 2, 3, 4, 5, 6 or 7 only. My primary axis is a DateTimeAxis, and my secondary axis is defined as follows:

<chart:SfChart.SecondaryAxis>
       <chart:NumericalAxis ShowMinorGridLines="false" ShowMajorGridLines="true" Maximum ="7" Minimum="1" Interval="1" RangePadding="Normal">
       </chart:NumericalAxis>
</chart:SfChart.SecondaryAxis>
  

(with title, grid line style and strip lines removed for clarity).

With the above markup, the problem is that any data points on the 1 or 7 line have their marker (a circle) cut in half, as they are right on the edge of the graph (vertically).

On Android, when I made the minimum 0.75 and the maximum 7.25, it gave me a nice spacing around the data, and meant that data points on the 1 or 7 line, which are marked with a circle, were fully visible. However, on iOS this setup led to the major grid lines being at 1.25, 2.25, etc, instead of at 1, 2, etc.

Is there a way that I can ensure there is space above and below the data, while keeping the grid lines on 1, 2, 3, etc on both platforms? I've experimented with the RangePadding setting but I haven't managed to get it to work how I'd like it.

Thanks,

David

3 Replies

MS Mohamed Samsudeen K S Syncfusion Team February 17, 2016 07:23 AM UTC

Hi David,

Thanks for contacting Syncfusion support.

It is possible to achieve spacing in both DateTime and Numerical axis using PlotOffset property as shown below.


<chart:SfChart.PrimaryAxis>

    <chart:DateTimeAxis PlotOffset="20"/>

</chart:SfChart.PrimaryAxis>


<chart:SfChart.SecondaryAxis>

    <chart:NumericalAxis PlotOffset="20"/>
</chart:SfChart.SecondaryAxis>


We have created a sample, please find it in the below link.

SimpleSample

Regards,
Samsudeen K S


DC David Conlisk June 9, 2016 10:50 AM UTC

Hi,

Sorry for the delay. This works great - thanks!

David


SP Saravana Pandian Murugan Syncfusion Team June 10, 2016 04:54 AM UTC

Hi David,

Thanks for your update. We are glad to know that your issue is resolved. Please get back to us if you need any further assistance.

Thanks,
Saravana Pandian M.


Loader.
Live Chat Icon For mobile
Up arrow icon