Group: Forum Members
Last Active: 14 Years Ago
Posts: 7,
Visits: 1
|
I'm having a problem that is hard to describe but is quite simple and probably has a simple solution (I'm probably doing something wrong).
I have some data I'd like to display as a stacked area chart. The data comes in the form of a few series, each with values associated with a particular date time. So the X-Axis is the time, and the Y Axis is the value. In a nutshell, the graph is not respecting the XValues I'm assigning for each data point.
I create each series like this:
NAreaSeries areaSeries = (NAreaSeries)Chart.Series.Add(SeriesType.Area); areaSeries.Name = name; areaSeries.UseXValues = true;
I then iterate through my data, adding data points like this:
NDataPoint dp = new NDataPoint(); dp[DataPointValue.Value] = value; dp[DataPointValue.X] = xValue; series.AddDataPoint(dp);
(value is a double, xValue is a datetime)
Around a certain time of day there is no data available for one of the series. I continue to add data points for the other series, and I'd expect that to show on the graph as zero. I would expect the graph to reflect that at that point on the XAxis - ie at that time of day the series is not visible / has no area on the graph.
But instead, that series shows as having values at that time of day - it just takes the data from later on in the day and shows it at that time - it does not respect the xValue I've assigned above. It "runs out" of data towards the right hand side of the graph, so it's showing as having no data later on in the day, even though there is.
Hope I've explained this clearly. How should I be adding data to the series so that if there's no data points for a certain period of time, the graph shows that instead of just taking the next available data point in the series (which is for a different time).
|