Hi David,
The chart simply has no enough data to stack correctly the two areas - you need to add values to germany (as it is the master of the stack and therefore the chart will not plot anything for data points where the master series values are invalid:
NChartControl ChartHolder = nChartControl1;
ChartHolder.Panels.Clear();
ChartHolder.Dock = DockStyle.Fill;
NChart Chart = new NCartesianChart();
Chart.BoundsMode = BoundsMode.Stretch;
ChartHolder.Charts.Add(Chart);
NAreaSeries Germany = (NAreaSeries)Chart.Series.Add(SeriesType.Area);
Germany.DataLabelStyle.Visible = false;
Germany.MultiAreaMode = MultiAreaMode.Stacked;
Germany.UseXValues = true;
Germany.FillStyle = new NColorFillStyle(Color.Red);
NAreaSeries France = (NAreaSeries)Chart.Series.Add(SeriesType.Area);
France.DataLabelStyle.Visible = false;
France.MultiAreaMode = MultiAreaMode.Stacked;
France.UseXValues = true;
France.FillStyle = new NColorFillStyle(Color.Blue);
int franceValue = 80;
int germanyValue = 50;
DateTime now = DateTime.Now;
for (int i = 0; i < 30; i++)
{
int numMinutes = i * 5;
int points = i * 2;
now = now.AddMinutes(numMinutes);
double oaNow = now.ToOADate();
France.AddDataPoint(new NDataPoint(franceValue - points));
France.XValues.Add(oaNow);
if (i < 9 || i > 15)
{
Germany.AddDataPoint(new NDataPoint(germanyValue));
Germany.XValues.Add(oaNow);
}
else
{
Germany.Values.Add(DBNull.Value);
Germany.XValues.Add(oaNow);
}
}
NAxis axis = Chart.Axis(StandardAxis.PrimaryX);
NRangeTimelineScaleConfigurator timelineScale = new NRangeTimelineScaleConfigurator();
axis.ScaleConfigurator = timelineScale;
Note that when you pass null values the chart will treat them differently from 0 (which may be the way to go here if you want more "common" visual results).
Hope this helps - let me know if you have any questions or meet any problems.
Best regards,
Bob