We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Unable to plot on secondary axis

Dear support,


I am trying to create chart and I am trying to plot a series on a secondary axis.
This does not seem to work. I am using:

Dim s As Aspose.Cells.Charts.Series = oChartXL.NSeries(1)
s.PlotOnSecondAxis = True

I am able to do this via Microsoft Excel though.
Please help me to resolve this problem!

I am including a vb.net project with an example, also a screenshot of
how I did this with Microsoft excel, and an additional sheet where
the secondary axis has been set for the series in question.

I am using the latest version of Aspose Cells to date: 8.3.1

Finally, I have also an example where the secondary axis seems to be
set, if I check the value in MS excel, it is set. But in the chart this is not
visible. Interestingly if I set it back to primary and then back to secondary,
then it is working. (Unfortunately I cannot share any more info about this.

Thanks a lot,

Tamas

Hi Tamas,

Thanks for your posting and using Aspose.Cells.

After initial investigation, we were able to observe this issue. PlotOnSecondAxis is not working properly. However, we need your runnable sample console application project replicating this issue with the latest version: Aspose.Cells
for .NET v8.3.1.4
so that we could run it at our end and log this issue for a fix.

Thanks for your cooperation.

Hi Shakeel,


Thank you for your reply.

I am sending you the same example project referencing the latest version of the Aspose Cells dll.
It still does not seem to work. I hope that this will give you enough information to
work towards a fix.

Kind regards,

Tamas

Hi Tamas,

Thanks for your sample project and using Aspose.Cells.

We were able to replicate this issue with your sample project using the latest version. We have therefore logged this issue in our database for investigation.

We will look into it and fix this issue. Once, the issue is resolved or we have some other update for you, we will let you know asap.

This issue has been logged as

  • CELLSNET-43311 - Unable to plot series on the secondary axis

Hi Tamas,

Thanks for using Aspose.Cells.

We have fixed your code and attached the fixed project for you which generates correct output Excel file as desired by you.

We have made changes in these lines. Changes are highlighted in red color. I have also attached the output Excel file generated by the fixed project for your reference


oPvtXL.DataBodyRange.StartColumn) & “:” & Aspose.Cells.CellsHelper.CellIndexToName(oPvtXL.DataBodyRange.EndRow, oPvtXL.DataBodyRange.EndColumn - 1)



Dim s As Aspose.Cells.Charts.Series = oChartXL.NSeries(1)
s.PlotOnSecondAxis = True

Hi Shakeel,


Thank you for your reply.

It seems that my issue was that I did not include the line:

oChartXL.SecondValueAxis.IsVisible = True

With this, the chart generates the secondary axis.

Thanks a lot for your help!

Kind regards,

Tamas

Hi Tamas,

Thanks for your feedback and using Aspose.Cells.

Yes, you are right. This was the main line that fixes your issue. Let us know if you encounter any other issue, we will be glad to look into it and help you further.