Nevron Forum

Why Series on chart's SecondaryYAxis is not visible in StackedAreaChart??

https://www.nevron.com/Forum/Topic6425.aspx

By Niranjan Singh - Tuesday, August 28, 2012

I have added 3 Series to StackedAreaChart and First two are shown corresponding to PrimaryYAxis and third one is shown respect to SecondaryYAxis, But it does not shown on the chart..

//code to create series..
NAreaSeries stackedAreaSeries = new NAreaSeries();
stackedAreaSeries.UniqueId = new Guid(outputVariable.UniqueId);
stackedAreaSeries.Name = outputVariable.LegendText;
chart.Series.Add(stackedAreaSeries);
indexOfSeries = chart.Series.IndexOf(stackedAreaSeries);

stackedAreaSeries.MultiAreaMode = chart.Series.Count == 1 ?
MultiAreaMode.Series : MultiAreaMode.StackedPercent;
ConfigureChartSeries(stackedAreaSeries, indexOfSeries, outputVariable);
SetSeriesAxisInformation(stackedAreaSeries, outputVariable.Unit);
stackedAreaSeries.UseXValues = true;
foreach (DataRow row in seriesDataTable.Rows)
{
stackedAreaSeries.XValues.Add(Convert.ToDateTime(row["col1"]));
}
dataBindingManager.AddBinding(0, indexOfSeries, "Values", seriesDataTable, outputVariable.UniqueId);
Check the attached image..


// It is used with some condition to specify the series on axis and working good with all other series except StackArea Area and StackAreaPercent Chart..
series.DisplayOnAxis(StandardAxis.PrimaryY, true);
series.DisplayOnAxis(StandardAxis.SecondaryY, false);


Is there any description that show what are the data requirements to use these chart. e.g. whether they need minimum 2 series or something like that..

Is there any solution of above problem, Any reference or suggestion will be admired..

Thanks in advance..



By Nevron Support - Monday, September 3, 2012

Hi Niranjan,

When you use a stack series only the properties for axis scaling of the master series are regarded. If you need to use a secondary axis you can create an invisible series and insert values that define that axis range there.