X-Axis interval/ticks

Hi all,

I have a chart were I visualize a list of the following class:

public class Data(){ 
    public int Inning { get; set; }
    public int Score { get; set; }
}

Example data:

Inning is always a counter starting from 0 and incremented by 1

Score can be any integer number

I now want to show the inning on the x-axis with only ticks coming from the "Inning" property.

I use the follwing code for the x-Axis:

            SFNumericalAxis xAxis = new SFNumericalAxis();
            xAxis.Title.Text = new NSString(axisTitle);
            xAxis.Title.Color = Style.OldWhite;
            xAxis.AutoScrollingDelta = 10.0;
            xAxis.AutoScrollingMode = ChartAutoScrollingMode.End;
            xAxis.Interval = new NSNumber(1);
            xAxis.AxisLineStyle.LineColor = UIColor.Orange;
            xAxis.Minimum = new NSNumber(0);

This works fine as long as I never zoom in etc

After zooming the chart calculates the x-Axis ticks on its own.

How can I show only the numbers that come from my data source property "Inning" no matter if someone zooms, autoscrolls, pans or what ever?

Regards

Michael


3 Replies

DV Divya Venkatesan Syncfusion Team April 6, 2018 06:18 AM UTC

Hi Michael, 
 
Thanks for using Syncfusion products. 
 
Your requirement can be achieved by setting EnableAutoIntervalOnZooming as false as shown in below code snippet. 
 
Code snippet[C#]: 
xAxis.EnableAutoIntervalOnZooming = false; 
 
Please let us know if you need any further assistance. 
 
Regards, 
Divya Venkatesan 
 



MI Michael April 6, 2018 05:49 PM UTC

Thanks,

exactly what I was looking for.

Regards
Michael


DV Divya Venkatesan Syncfusion Team April 9, 2018 09:12 AM UTC

Hi Michael, 
 
Thanks for your update and please let us know if you need any further assistance. 
 
Regards, 
Divya Venkatesan 


Loader.
Up arrow icon