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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Chart Control and Dates give strange results

Thread ID:

Created:

Updated:

Platform:

Replies:

15201 Jun 14,2004 03:44 PM UTC Dec 14,2005 03:14 PM UTC WinForms 4
loading
Tags: Chart
Eric Duesing
Asked On June 14, 2004 03:44 PM UTC

If I take a chart control and drop it on the form then add the following to form load: ChartSeries s= chartControl1.Model.NewSeries("Licenses",ChartSeriesType.Area); s.Points.Add(Convert.ToDateTime("4/4/2004 12:00:00"),81); s.Points.Add(Convert.ToDateTime("4/11/2004 12:00:00"),84); s.Points.Add(Convert.ToDateTime("4/18/2004 12:00:00"),82); s.Points.Add(Convert.ToDateTime("4/25/2004 12:00:00"),87); s.Points.Add(Convert.ToDateTime("5/2/2004 12:00:00"),94); s.Points.Add(Convert.ToDateTime("5/9/2004 12:00:00"),104); s.Points.Add(Convert.ToDateTime("5/16/2004 12:00:00"),112); s.Points.Add(Convert.ToDateTime("5/23/2004 12:00:00"),112); s.Points.Add(Convert.ToDateTime("6/1/2004 12:00:00"),116); s.Points.Add(Convert.ToDateTime("6/6/2004 12:00:00"),116); s.Points.Add(Convert.ToDateTime("6/13/2004 12:00:00"),127); chartControl1.Series.Add(s); chartControl1.Legend.Visible=false; chartControl1.PrimaryXAxis.ValueType=ChartValueType.DateTime; I would expect it to give me the dates along the bottom, no? I''m using 2.0.5.1.

Sean Greer
Replied On June 15, 2004 02:20 PM UTC

Thanks for asking this Eric, as I''m having the dilemna with 2.0.6.0. I do this: ChartSeries cs = this.m_ChartControl.Model.NewSeries(string.Format("{0} Product Projection", nYear), ChartSeriesType.Bar); cs.Points.Add(new DateTime(nYear, 1, 1), Convert.ToDouble(drv["productproj"])); cs.Text = cs.Name; cs.Type = ChartSeriesType.Column; I''ve got these settings for the x axis: PrimaryXAxis.ValueType = ChartValueType.DateTime; PrimaryXAxis.IntervalType = ChartDateTimeIntervalType.Years; PrimaryXAxis.DateTimeFormat = "yyyy"; And I get 1899 for each column. What''s up with that?

Davis Jebaraj [Syncfusion]
Replied On June 15, 2004 05:52 PM UTC

Hi, Please add this line to set the Indexed mode to false and the values will be interpreted properly: this.chartControl1.Indexed = false; It would also help to rotate the labels along the X axis to prevent them from overlapping: this.chartControl1.PrimaryXAxis.LabelRotate = true; this.chartControl1.PrimaryXAxis.LabelRotateAngle = 90; Thank you for your patience. Regards, Davis

Eric Duesing
Replied On June 16, 2004 12:32 PM UTC

Doh! You are correct. >Hi, > >Please add this line to set the Indexed mode to false and the values will be interpreted properly: > > this.chartControl1.Indexed = false; > >It would also help to rotate the labels along the X axis to prevent them from overlapping: > >this.chartControl1.PrimaryXAxis.LabelRotate = true; > >this.chartControl1.PrimaryXAxis.LabelRotateAngle = 90; > >Thank you for your patience. > >Regards, > >Davis > > >

Administrator [Syncfusion]
Replied On December 14, 2005 03:14 PM UTC

>Doh! You are correct. > >>Hi, >> >>Please add this line to set the Indexed mode to false and the values will be interpreted properly: >> >> this.chartControl1.Indexed = false; >> >>It would also help to rotate the labels along the X axis to prevent them from overlapping: >> >>this.chartControl1.PrimaryXAxis.LabelRotate = true; >> >>this.chartControl1.PrimaryXAxis.LabelRotateAngle = 90; >> >>Thank you for your patience. >> >>Regards, >> >>Davis >> >> >>

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

;