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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

DateTime value in X-Axis

Thread ID:





70527 Dec 14,2007 08:42 AM UTC Dec 19,2007 12:24 PM UTC WinForms 1
Tags: Chart
Asked On December 14, 2007 08:42 AM UTC


I have a problem displaying > 5000 record in line chart.

The data in record are as follow:
Price DateTime
795.0700000 2007-12-14 00:00:01.857
795.6000000 2007-12-14 00:00:03.860
795.4300000 2007-12-14 00:00:05.860

I want to display Price in Y-Axis and DateTime in X-Axis. But X-Axis doesn't seem to draw the data correctly eventhough I tried to adjust DateTime range and Interval of DateTime.

Below are the sample code I used:

hartControl1.Indexed = true;
mDataBindModel = new ChartDataBindModel(this.mFeedDs, "");
ChartSeries series = this.chartControl1.Model.NewSeries("Market");

mDataBindModel.XName = "Time";
mDataBindModel.YNames = new string[] { "Price" };
series.Type = ChartSeriesType.Line;

series.SeriesModelImpl = mDataBindModel;
series.Style.DisplayShadow = false;


this.chartControl1.PrimaryXAxis.DrawGrid = false;

this.chartControl1.PrimaryXAxis.RangeType = ChartAxisRangeType.Set;
this.chartControl1.PrimaryXAxis.ValueType = ChartValueType.DateTime;
this.chartControl1.PrimaryXAxis.DateTimeFormat = "HH:MM";
this.chartControl1.PrimaryXAxis.DateTimeRange = new ChartDateTimeRange(DateTime.Now.AddDays(-1), DateTime.Now, 5, ChartDateTimeIntervalType.Hours);

this.chartControl1.PrimaryYAxis.RangeType = ChartAxisRangeType.Set;
this.chartControl1.PrimaryYAxis.Range.Min = 700;
this.chartControl1.PrimaryYAxis.Range.Max = 900;

this.chartControl1.PrimaryYAxis.Range.Interval = 50;
this.chartControl1.PrimaryYAxis.DrawGrid = false;

this.chartControl1.Text = "";
this.chartControl1.PrimaryYAxis.Title = "";

I hope someone can help me to solve the problem.



SubhaSheela R [Syncfusion]
Replied On December 19, 2007 12:24 PM UTC

Hi Aung,

I apologize for the delay in responding.
I have created a sample with line chart that describes how to set DateTime in X-axis. Please refer to the link below that illustrates the same.

Please let me know if it helps.

Subhasheela R


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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