Hi,
I'm using WinChart 9.1 and want to display a NumericTimeSeries with the date-value on the x-axis and the amount on y-axis. Everything is fine, but after 15 columns the chart ends on the x-axis and no bigger values are displayed.
Thanks a lot,
Alex
The chart shouldn't normally have any trouble displaying a large amount of data. Perhaps something is preventing it from doing so. Here's a few things you can check:if you have more than one series, make sure that each series has an equal amount of points. Otherwise, you have to use a composite chart.Make sure that you're not setting a range on the X axis. Check chart.Axis.X.RangeMin/RangeMax/RangeType properties
As a sanity check try this code and see if it works:
DataTable dt = new DataTable();dt.Columns.Add("date", typeof(DateTime));dt.Columns.Add("value", typeof(double));dt.Columns.Add("label", typeof(string));
for (int i = 0; i < 50; i++){ dt.Rows.Add(DateTime.Now.AddDays(i), i, "label " + i);}
NumericTimeSeries series = new NumericTimeSeries();series.Data.DataSource = dt;series.Data.TimeValueColumn = "date";series.Data.LabelColumn = "label";series.Data.ValueColumn = "value";series.DataBind();
ultraChart1.ChartType = ChartType.LineChart;ultraChart1.LineChart.TreatDateTimeAsString = false;ultraChart1.Series.Add(series);
Hi Max,
sorry, didn't saw your post :-). I still got the same issue. If I just change the Chart-type to StepLineChart, the X-scale is correct?!?!? What is it?
I changed nothing on the axis-properties as you suggested in your post!
If none of my previous suggestions help, you can post your code (or the sample project) here and I'll take a look at it.
thanks a lot. It was the proeprty "TreatDateTimeAsString". After I set it to false, everything worked fine!
Here's a sample project that loads the grid rows into a NumericTimeSeries. The series displays 100 points. See if you get the same behavior on your machine.
ok, lets try this. I've got a method which adds all series and points as follows:
chartControl.Series.Clear(); NumericTimeSeries ntsValues = null;List<NumericTimeSeries> lstAKBM = new List<NumericTimeSeries>();bool blnFound;foreach (UltraGridRow rowParent in grdAKBM.Rows){ foreach (UltraGridRow rowChild in rowParent.ChildBands[0].Rows) { blnFound = false; string strLabel = rowChild.GetCellValue("COL_CATEGORY").ToString(); DateTime dtmThis = DateTime.Parse(rowParent.GetCellValue("COL_DATE").ToString()); double dblAmount = double.Parse(rowChild.GetCellValue("COL_AMOUNT").ToString()); foreach (NumericTimeSeries ntsFind in lstAKBM) { if (ntsFind.Key.Equals(strLabel)) { blnFound = true; ntsValues = ntsFind; break; } } if (!blnFound) { ntsValues = new NumericTimeSeries(); ntsValues.Key = strLabel; ntsValues.Label = strLabel; } ntsValues.Points.Add(new NumericTimeDataPoint(dtmThis, dblAmount, dtmThis.ToShortDateString(), false)); if (!blnFound) { chartControl.Series.Add(ntsValues); lstAKBM.Add(ntsValues); } }}
It's a little bit tricky because it gets the data out of a grid, but anyway. The keypoint is, that the Series-property of the chart containst all series (which are displayed in the chart) and each series got 100 points. The chart displays only 15 points.