Page 1 of 1

Assign Custom Axis

Posted: Thu Apr 12, 2012 3:46 pm
by 13048623
I am trying to reassign Series Vertical axis from Left to Custom and back in code using C# and cannot seem to get the correct syntax. I have tried this:

Series1.VertAxis = Steema.TeeChart.Styles.VerticalAxis.Left;
Series2.VertAxis = Steema.TeeChart.Styles.VerticalAxis.Custom;

AND this:
Series1.VertAxis = Steema.TeeChart.Styles.VerticalAxis.Left;
Series2.VertAxis = Steema.TeeChart.CustomAxes[0];

getting Errors saying:
Cannot implicitly convert type Steema.TeeChart.Axis to Steema.TeeChart.Styles.VerticalAxis

and
Steema.TeeChart.CustomAxes is a tpe which is not valid in the given context.

The custom axis and series are all set uo in the Chart Editor and work fine.

thanks

Re: Assign Custom Axis

Posted: Thu Apr 12, 2012 4:06 pm
by 13048623
Finally figured it out...


Series1.VertAxis = Steema.TeeChart.Styles.VerticalAxis.Left;
Series1.CustomVertAxis = tChart3.Axes.Custom[0];

tChart3.Axes.Left.Title.Caption = "A";
tChart3.Axes.Custom[0].Title.Caption = "B";

Re: Assign Custom Axis

Posted: Fri Apr 13, 2012 11:44 am
by 10050769
Hello KevL,

Always you use custom axes and you want assign these to series, you need use Series.CustomVertAxis or Series.CustomHorizAxis. I am glad you finally have found it and you can solve your problem.:D

Thanks,