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