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.

line chart skips the second month on the xaxis if the first month is a odd number mouth

Thread ID:

Created:

Updated:

Platform:

Replies:

58455 Mar 23,2007 03:21 PM Apr 17,2007 06:49 AM Windows Forms 5
loading
Tags: Chart
Hongbin Zhang
Asked On March 23, 2007 03:21 PM

I am using v3.2. I am building a line chart. It's very werid that the label of the Xaxis would repeat the first odd number month on the second position, it does't happen to the even number month as the start position, is this a bug with v3.2? how can I get around it?

Also, is there a way to leave a little room on the most left and right position without ruining the graph? I tried to make the start point a month earlier and end point a month later, it will shift the line to the earlier month too.

Thanks!

lineChartIssue.doc0.zip

Hongbin Zhang
Replied On March 26, 2007 11:22 AM

Below is a code snippet for this issue:

myChart.PrimaryXAxis.ValueType = ChartValueType.DateTime;
myChart.PrimaryXAxis.DateTimeFormat = xAxisFormat;
myChart.PrimaryXAxis.RangeType = ChartAxisRangeType.Set;

DateTime dateMin=DateTime.Now,dateMax=DateTime.Now;
int dataCount = myChart.Series[0].SeriesModelImpl.Count;
if (dataCount > 0)
{
dateMin = DateTime.FromOADate(traceChart.Series[0].SeriesModelImpl.GetX(0));
dateMax = DateTime.FromOADate(traceChart.Series[0].SeriesModelImpl.GetX(dataCount-1));
}
myChart.PrimaryYAxis.DateTimeRange = new ChartDateTimeRange(dateMin,dateMax,intervalVal,ChartDateTimeIntervalType.Months);

It would be much appreciated if you can reply in your earliest convienence..

Thanks,
HB


>I am using v3.2. I am building a line chart. It's very werid that the label of the Xaxis would repeat the first odd number month on the second position, it does't happen to the even number month as the start position, is this a bug with v3.2? how can I get around it?

Also, is there a way to leave a little room on the most left and right position without ruining the graph? I tried to make the start point a month earlier and end point a month later, it will shift the line to the earlier month too.

Thanks!

lineChartIssue.doc0.zip

Hongbin Zhang
Replied On March 26, 2007 11:24 AM

sorry, the code is a bit mixed up, here again:

myChart.PrimaryXAxis.ValueType = ChartValueType.DateTime;
myChart.PrimaryXAxis.DateTimeFormat = xAxisFormat;
myChart.PrimaryXAxis.RangeType = ChartAxisRangeType.Set;

DateTime dateMin=DateTime.Now,dateMax=DateTime.Now;
int dataCount = myChart.Series[0].SeriesModelImpl.Count;
if (dataCount > 0)
{
dateMin = DateTime.FromOADate(myChart.Series[0].SeriesModelImpl.GetX(0));
dateMax = DateTime.FromOADate(myChart.Series[0].SeriesModelImpl.GetX(dataCount-1));
}
myChart.PrimaryYAxis.DateTimeRange = new ChartDateTimeRange(dateMin,dateMax,intervalVal,ChartDateTimeIntervalType.Months);

Thanks,
HB


>Below is a code snippet for this issue:

myChart.PrimaryXAxis.ValueType = ChartValueType.DateTime;
myChart.PrimaryXAxis.DateTimeFormat = xAxisFormat;
myChart.PrimaryXAxis.RangeType = ChartAxisRangeType.Set;

DateTime dateMin=DateTime.Now,dateMax=DateTime.Now;
int dataCount = myChart.Series[0].SeriesModelImpl.Count;
if (dataCount > 0)
{
dateMin = DateTime.FromOADate(traceChart.Series[0].SeriesModelImpl.GetX(0));
dateMax = DateTime.FromOADate(traceChart.Series[0].SeriesModelImpl.GetX(dataCount-1));
}
myChart.PrimaryYAxis.DateTimeRange = new ChartDateTimeRange(dateMin,dateMax,intervalVal,ChartDateTimeIntervalType.Months);

It would be much appreciated if you can reply in your earliest convienence..

Thanks,
HB


>I am using v3.2. I am building a line chart. It's very werid that the label of the Xaxis would repeat the first odd number month on the second position, it does't happen to the even number month as the start position, is this a bug with v3.2? how can I get around it?

Also, is there a way to leave a little room on the most left and right position without ruining the graph? I tried to make the start point a month earlier and end point a month later, it will shift the line to the earlier month too.

Thanks!

lineChartIssue.doc0.zip

Rajesh C [Syncfusion]
Replied On March 30, 2007 06:41 PM

Hi,

Thank you for using Syncfusion products.

I am able to reproduce the mentioned issue in v3.2. This issue has been fixed in v4.1. Please upgrade to latest version.

Now, We will going to release Essential studio v5.1 with more essential features.

Regards,
Rajesh

Hongbin Zhang
Replied On April 16, 2007 04:21 PM

Hi, I upgraded my Syncfusion to v4.2. but this issue still exists:

I am using:

lineChart.PrimaryXAxis.DateTimeRange = new ChartDateTimeRange(dateMin,dateMax,1,ChartDateTimeIntervalType.Months);

dateMin = new DateTime(2006,10,01),
dateMax = new DateTime(2007,03,01)
The second month should be 2006-Nev, but it makes as 10/31/2006.

please see the attached screenshot. is this a bug in v4.2 as well?

thanks,
HB

lineChartIssue0.zip

Ramya R [Syncfusion]
Replied On April 17, 2007 06:49 AM

Hi,

I was not able to reproduce the condition that you have mentioned here. I used v4.2.0.37 and the below shown code snippet to reproduce the issue,

DateTime dateMin;
DateTime dateMax;
ChartSeries series =this.chartControl1.Model.NewSeries("MySeries",ChartSeriesType.Line);
dateMin = new DateTime(2006,10,01);
dateMax = new DateTime(2007,03,01);
DateTime[] xArray = new DateTime[]{dateMin,dateMin.AddMonths(1),dateMin.AddMonths(2)};
double[] yArray = new double[]{10,3,7};
series.SeriesModelImpl = new DateXSeriesModel(xArray,yArray);
this.chartControl1.Series.Add(series);
this.chartControl1.PrimaryXAxis.LabelRotate=true;
this.chartControl1.PrimaryXAxis.LabelRotateAngle=90;
this.chartControl1.PrimaryXAxis.ValueType=ChartValueType.DateTime;
this.chartControl1.PrimaryXAxis.DateTimeRange = new ChartDateTimeRange(dateMin,dateMax,1,ChartDateTimeIntervalType.Months);

but I was not able to reproduce it.

I was only able to see that Min and Max values were not getting displayed correctlyin v4.2. This issue with Min and Max values has been resolved in our latest version 4.4.0.51.

I have attached the samples both in v4.2 and v4.4 which I used for reproducing this issue.

You can download the sample from the below given Webpage link,

Sample for 4.2:
http://websamples.syncfusion.com/samples/Chart.Windows/F58455-I/main.htm

Sample for 4.4:
http://websamples.syncfusion.com/samples/Chart.Windows/F58455-II/main.htm

Kindly take a look at the attached samples and let me know if I have missed any steps in reproducing the issue.

Thanks & Regards,
Ramya.

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.

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.

;