We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Scatter Chart

How can I get the location of the x-axis line and y-axis line in respect to the chart area. I notice they move location depending on data.


5 Replies

AD Administrator Syncfusion Team April 8, 2009 08:15 PM UTC

Basically, I need the chartInterior's location and width. I can get the chartArea's location and width, but I need the chartInterior's location and width since it changes with respect to the data.



MS Manimala S Syncfusion Team April 9, 2009 12:25 PM UTC

Hi,

We have the properties of the chart axis to get the location and width of the chart interior.

This can be done in the following way.

For width of the chart interior we have:

this.chartControl1.PrimaryXAxis.RealLength.ToString();

which return the length of the X-Axis, which is the width of the chart interior.

And for getting the location of the chart interior we have the location property of the axis.

eg:
this.chartControl1.PrimaryXAxis.Location.X.ToString();
this.chartControl1.PrimaryXAxis.Location.Y.ToString();

this gives the location of the chart interior.

I have created a simple sample to demonstrate this.

Kindly, get the sample from the following location

Sample File

Kindly, let me know if it meets your requirement.

Thanks,
Manimala.





AD Administrator Syncfusion Team April 9, 2009 04:31 PM UTC

Please See attached image of what I need. When I use the:
chartControl1.ChartArea.PrimaryXAxis.Location.X
chartControl1.ChartArea.PrimaryXAxis.Location.Y

These don't give me the actual location of the X and Y axis. I need the width of the area in green.

using this.chartControl1.PrimaryXAxis.RealLength, I get a value of 750 but, the area in green seems to be only 725. Does the
this.chartControl1.PrimaryXAxis.RealLength include the areas in yellow, too?

The area in green changes dynamically based on data and labels on the x and y axis line.

Thanks,
Aymiee



ScatterImage_58cf5976.zip


AD Administrator Syncfusion Team April 11, 2009 05:09 PM UTC

Thanks, your solution did the trick. I had to take into consideration the margins.



MS Manimala S Syncfusion Team May 11, 2009 06:27 AM UTC

Hi Aymiee,

That was great. Thanks for the update.

Thanks for your continuous support.

Thanks,
Manimala.


Loader.
Live Chat Icon For mobile
Up arrow icon