How to determine size of axis (+ label + title)

When my chart have multiple Y-axis, I knew I should manually add more right margin, so that there are enough space to display all the axis.

The problem is I don't know how big each axis is, is there any way to determine the size of each axis, plus its label and title, so that I can correctly add the margin?

2 Replies

AD Administrator Syncfusion Team March 30, 2007 10:32 AM UTC

Hi Pisin,

My apologies for the delay in responding to you.

If your intention is to view all the axes at the left side of Chart then it can be done by adjusting the margin of ChartArea as shown in the code snippet below,

this.chartControl1.ChartArea.ChartAreaMargins.Left = (int)(this.chartControl1.PrimaryYAxis.Location.X - axis1.Location.X);
// Here axis1 is the last secondaryaxis.
//The PrimaryYAxis's and last secondaryaxis's location should be used for the calculation of ChartAreaMargin.

Kindly take a look at the attached sample.

You can download the sample from the below given Webpage link,
http://websamples.syncfusion.com/samples/Chart.Windows/F58821/main.htm

Let me know whether this helps you.

Thanks & Regards,
Ramya.


PB Pisin Bootvong March 30, 2007 07:14 PM UTC

Hi,

thank you,
the offset calculation works great.

Loader.
Up arrow icon