Problems using SecondValueAxis

I have 4 time-series displayed in 1 chart, 2 in the value-range specified on the left axis and 2 in the value-range specified on the right-axis. The chart displayed the right-axis graphs as "column chart" and not the "line chart"that I want to draw. I've included the code that creates the charts below. Please help me understand the cause of the incorrect "column chart" on the second axis. My goal is to have all 4 graphs as "Line" chart-type.

idx = workbook.Worksheets.Add();

Worksheet tick = workbook.Worksheets[idx];

tick.Name = k;

DataTable dt = this.mktData[k] as DataTable;

tick.Cells.ImportDataTable(dt, true, 0, 0, false);

int cidx = tick.Charts.Add( Aspose.Cells.ChartType.Line, upperLeftRow, upperLeftCol, lowerRightRow, lowerRightCol );

Aspose.Cells.Chart chart = tick.Charts[cidx];

chart.NSeries.Add(String.Format("D2:D{0}", dt.Rows.Count), true );

chart.NSeries.Add(String.Format("E2:E{0}", dt.Rows.Count), true );

chart.NSeries.Add(String.Format("K2:K{0}", dt.Rows.Count), true );

chart.NSeries.Add(String.Format("L2:L{0}", dt.Rows.Count), true );

chart.NSeries[0].Type = Aspose.Cells.ChartType.Line;

chart.NSeries[1].Type = Aspose.Cells.ChartType.Line;

chart.NSeries[2].Type = Aspose.Cells.ChartType.Line;

chart.NSeries[3].Type = Aspose.Cells.ChartType.Line;

chart.NSeries[2].PlotOnSecondAxis =true;

chart.NSeries[3].PlotOnSecondAxis =true;

chart.SecondValueAxis.IsVisible = true;

chart.SecondValueAxis.Title.Text="Percent";

chart.NSeries.CategoryData = String.Format("B2:B{0}", dt.Rows.Count); //Dates

tick.Cells.Columns[1].Style.Number = 18;

MarketDataNode mktData = trading.getMarketData(k);

chart.ValueAxis.MinValue = Math.Floor(mktData.low);

chart.ValueAxis.MaxValue = Math.Ceiling(mktData.high);

chart.ValueAxis.IsVisible = true;

chart.SecondValueAxis.MinValue = 0;

chart.SecondValueAxis.MaxValue = 1;

chart.NSeries[0].Name = "Bid";

chart.NSeries[1].Name = "Ask";

chart.NSeries[2].Name = "High Cumulative";

chart.NSeries[3].Name = "Low Cumulative";

Hi,

Thanks for considering Aspose.

Which version of Aspose.Cells you are using? I use the following code with 4.1.2 version and the result is ok (Kindly check the attached file):

Workbook wb = new Workbook();

Worksheet worksheet = wb.Worksheets[0];

int chartIndex = worksheet.Charts.Add(ChartType.Line, 5, 0, 20, 8);

Chart chart = worksheet.Charts[chartIndex];

chart.ValueAxis.MinValue = 0;

chart.ValueAxis.MaxValue = 80;

chart.ValueAxis.MajorUnit = 10;

chart.SecondValueAxis.IsVisible = true;

chart.SecondValueAxis.MinValue = 0;

chart.SecondValueAxis.MaxValue = 1.4;

chart.SecondValueAxis.MajorUnit = 0.2;

chart.NSeries.Add("{50, 70, 20}", true);

chart.NSeries.Add("{30,40,20}",true);

chart.NSeries.Add("{0.6, 0.8, 1}", true);

chart.NSeries.Add("{0.4,0.2,1.2}",true);

chart.NSeries[2].PlotOnSecondAxis = true;

chart.NSeries[3].PlotOnSecondAxis = true;

chart.NSeries[0].Name = "A";

chart.NSeries[1].Name = "B";

chart.NSeries[2].Name = "C";

chart.NSeries[3].Name = "D";

wb.Save("d:\\test\\4nseries.xls");

If you are using the latest version, the problem might be with the source data of your chart. If so, kindly create a template excel file with the source data of your required chart and post us here.

Thank you.