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

XAxis date range not working

I have the following code where (as an example) dtStart = 5/1/04 and dtNow = 4/1/05. this.chartControl1.PrimaryXAxis.DateTimeRange = new ChartDateTimeRange(dtStart, dtNow, 1, ChartDateTimeIntervalType.Months); The datetime format is MM-yy. This results in the correct number of points but the labels are wrong and this seems related to the actual data. All I want is to plot one point per month for 12 months why is this so difficuly. Attached is the X-Axis generated from this code. x-axis_6693.zip

14 Replies

DJ Davis Jebaraj Syncfusion Team May 12, 2005 05:43 PM UTC

Hi Chuck, There is a bug in the current calculation of the range that increments the intervals by 30 days instead of by 1 month that results in irregular intervals. This problem can be worked around in your case if you start the date at 05/15/2004 instead of 05/01/2004. protected void InitializeChartData() { ChartSeries series = this.chartControl1.Model.NewSeries("Series 1"); DateTime start = new DateTime(2004,5,15); series.Points.Add(start, 300); series.Points.Add(start.AddMonths(1), 400); series.Points.Add(start.AddMonths(2), 200); series.Points.Add(start.AddMonths(3), 500); series.Points.Add(start.AddMonths(4), 200); series.Points.Add(start.AddMonths(5), 300); series.Points.Add(start.AddMonths(6), 600); series.Points.Add(start.AddMonths(7), 700); series.Points.Add(start.AddMonths(8), 300); series.Points.Add(start.AddMonths(9), 600); series.Points.Add(start.AddMonths(10), 500); series.Points.Add(start.AddMonths(11), 300); series.Points.Add(start.AddMonths(12), 400); series.Type = ChartSeriesType.Column; series.Text = series.Name; this.chartControl1.Series.Add(series); this.chartControl1.PrimaryXAxis.DateTimeRange = new ChartDateTimeRange(start.AddMonths(-1), start.AddMonths(13), 1, ChartDateTimeIntervalType.Months); this.chartControl1.PrimaryXAxis.ValueType = ChartValueType.DateTime; this.chartControl1.PrimaryXAxis.DateTimeFormat = "MM-yy"; } Thanks, Davis


AD Administrator Syncfusion Team May 12, 2005 08:13 PM UTC

Do you know when a fix for the date axis problem will be available? I hope to be able to make axis labels of the types - 1th of each month - 1th of each quarter (3 months) - 1th of each year Another problem is that the last label is chopped off. The problem is visible in the ChartDateHandling sample in version 3.2.1.0.


AD Administrator Syncfusion Team May 16, 2005 03:35 PM UTC

Hi, The axis issue should be fixed before the end of the week. We will make available a patch version with the fix. You can specify labels as desired after the fix is completed: 1. 1st of month - Specify a interval of 1 month 2. 1st of Quarter - Specify a interval of 3 months 3. 1st of year - Specify a interval of 1 year Thanks, Davis >Do you know when a fix for the date axis problem will be available? >I hope to be able to make axis labels of the types >- 1th of each month >- 1th of each quarter (3 months) >- 1th of each year > >Another problem is that the last label is chopped off. The problem is visible in the ChartDateHandling sample in version 3.2.1.0.


SR Shankar Ramasubramanian June 9, 2005 07:09 PM UTC

there is no PrimaryXAxis property in ChartWebControl. How do i set the xaxis as a date in chart web control --Shankar


AD Administrator Syncfusion Team June 11, 2005 05:18 AM UTC

Hi Shanker, The PrimaryXAxis has been moved to the ChartArea in the ChartWebControl. ChartwebControl1.ChartArea.PrimaryXAxis Regards, Davis


AD Administrator Syncfusion Team June 12, 2005 01:50 PM UTC

Hi Davis, Has the date x-axis problem been fixed? If so, how do I get new version?


AD Administrator Syncfusion Team June 15, 2005 09:50 PM UTC

Hi, The X axis date (with month interval) problem has not been fixed yet. I have increased the priority for this fix and it should completed within the next few days. Thank you for your patience. Regards, Davis


AD Administrator Syncfusion Team August 5, 2005 11:52 AM UTC

Hi. This fix has been promised for quite some time now. Is it available? Also, I wonder whether it will be necessary to update the whole essential studio to have this fix? I would prefer not, since I''m using many of the other packages and I am afraid that upgrading may break something else.


AD Administrator Syncfusion Team August 8, 2005 10:36 PM UTC

Hi, We regret for the delay in sending you the fix. This issue has been fixed internally. I had initially thought that the automatic scaling was incorectly adding 30 days to compute a month interval instead of adding a month itself. However, the implementation was structured in such a manner to accomodate the default range calculation model that requires all range intervals to be the same. We have added a custom implementation for the range now that takes this into account when the range type is in months. We will be releasing version 3.3.0.0 by tomorrow and I will post download instructions. Thanks, Davis


JD John DiBiase August 15, 2005 07:02 AM UTC

Hi, What is the status of this fix? Regards John


AD Administrator Syncfusion Team August 15, 2005 10:08 PM UTC

Hi John, You can download the latest version 3.3.0.0 with this fix from: ftp://syncpatch.syncfusion.com/essentialstudio/v3.3.0.0/syncfusionessentialstudiosetup.exe Thanks, Davis


AD Administrator Syncfusion Team August 16, 2005 07:46 AM UTC

Is this the official 3.3.0.0 version? Or will there be more testing/bug fixing before an official version is released?


AD Administrator Syncfusion Team August 16, 2005 11:54 AM UTC

Hi, This is the Release Candidate version. We will be making fixes if needed before the final version. Thanks, Davis


AD Administrator Syncfusion Team August 16, 2005 12:12 PM UTC

Hi Davis. When do you expect to release the final version? Is there any description available of what has been changed for the various products since v 3.2.1.0?

Loader.
Live Chat Icon For mobile
Up arrow icon