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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Axis Range and Interval settings

Thread ID:

Created:

Updated:

Platform:

Replies:

104700 Aug 10,2012 09:45 AM UTC Aug 16,2012 11:30 AM UTC WPF 1
loading
Tags: Chart
Fabian Tholl
Asked On August 10, 2012 09:45 AM UTC

Hello Guys,

i wanna create a chart with custom x-axis range and interval, but it doesn´t work :(
I had a look at your online documentation and i have written this code:



           ChartArea analogArea = new ChartArea();
            chart1.Areas.Add(analogArea);


            ChartSeries analogSeries = new ChartSeries(ChartTypes.Spline);

            chart1.Areas[0].Series.Add(analogSeries);

            chart1.Areas[0].PrimaryAxis.LabelRotateAngle = 270;


            chart1.Areas[0].PrimaryAxis.IsAutoSetRange = false;

            chart1.Areas[0].PrimaryAxis.ValueType = ChartValueType.DateTime;
            chart1.Areas[0].PrimaryAxis.DateTimeRange = new DateTimeRange(new DateTime(2012, 1, 1, 12, 0, 0), new DateTime(2012, 1, 1, 13, 30, 0));
            chart1.Areas[0].PrimaryAxis.MinimumDateTimeInterval = new TimeSpan(00, 15, 00);
            chart1.Areas[0].PrimaryAxis.DateTimeInterval = new TimeSpan(00, 15, 00);
           

            ChartListData points = new ChartListData();

            points.ChartXValueType = ChartValueType.DateTime;

            points.AddPoint(new DateTime(2012, 01, 01, 12, 00, 00), 1);
            points.AddPoint(new DateTime(2012, 01, 01, 12, 30, 00), 0);
            points.AddPoint(new DateTime(2012, 01, 01, 13, 00, 00), 1);
            points.AddPoint(new DateTime(2012, 01, 01, 13, 30, 00), 0);

            analogSeries.Data = points;

When I did not bind the data to the chart, the chart will be shown correctly!


Why does ist not work? Please help me!


best regards
Fabian Tholl

Rajkumar [Syncfusion]
Replied On August 16, 2012 11:30 AM UTC

Hi Tholl,

Thank you for choosing Syncfusion products.

We would like to inform you that we need to specify the IsIndexed as false, since by default ChartSeries will Indexed Series. Thus it can be resolved by specifying the IsIndexed=false as in below code snippet.

Code Snippet:
[C#]
analogSeries.IsIndexed = false;

Please let us know, if you need any further assistance.

Thanks,
Rajkumar B R

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;