المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Excel Chart Secondary Axis



C# Programming
09-24-2009, 06:20 AM
Hi!

I am creating an Excel Chart using C#. I have 2 series, and I would like one of them to have a seperate y axis on the right of the chart. Both axes should have different scales.

Excel 2003.
VS 2005.

I have a chart, and two series, but I can't see my second axis. It's like I never had one.

when creating my second series I do this:


elevationSeries.AxisGroup = XlAxisGroup.xlSecondary;
elevationSeries.Values = xlWorkSheet.get_Range ("C2", "C20");
elevationSeries.XValues = xlWorkSheet.getRange ("A2", "A20");
elevationSeries.Name = "Elevation";

Axis yAxis;

yAxis = (Excel.Axis)chartpage.Axes(Excel.XlAxisType.xlValues, Excel.XlAxisGroup.xlSecondary;
yAxis.HasTitle = true;
yAxis.AxisTitle.Text = "Elevation";



Thanks in advance.