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

Side-By-Side Y axis

I have a chart with 4 series, each with their own Y axis - each series is a different measurement. I use the legend tick boxes to show or hide individual series and allow the user to select whether the y axes are SideBySide or Stacked.

I use the LegendItem CheckedChanged event to hide the series' axis when the series is hidden, using the code below:

private void chartControl_LegendItem_CheckedChanged(object sender, EventArgs e)
{
for (int i = 0 ; i < _chart.Legend.Items.Length ; i++)
{
_chart.Series[i].YAxis.IsVisible = _chart.Legend.Items[i].IsChecked;
}
}

However, when a series, and its axis is hidden, a blank area is left, as shown in the attached image.

I have two questions:

1) How can I hide the blank area?
2) Is it possible to adjust how much vertical space (percentage?) is taken by each axis when they are shown SideBySide? Or is it a fixed percentage, i.e. 4 axes = 25% per axis.

Thanks,
Paul






BlankArea_b9fd2a05.jpg

6 Replies

MS Manimala S Syncfusion Team July 2, 2009 09:22 AM UTC

Hi Paul,

Thanks for using Essential Chart.

We can set the vertical spacing for the axis using the "RealLength" property of the axis. Here is the Code snippet.

//Code
axis.AutoSize = false;
axis.RealLength = ((int)(axis.Range.Delta / axis.Range.Interval) * 25);

And for removing empty space, sorry currently we don't have a direct property to remove the empty space, if any of the axis is removed in multiple axis. But we have a workaround to achieve this with the help of "RealLength" property of the axis.

I have created a sample to demonstrate this. Kindly, get the sample from the following link.

Sample

Kindly let me know if it works.

Thanks,
Manimala.


PW Paul Wallace July 2, 2009 12:50 PM UTC

Yes, that helped me do what I wanted.

Thanks,
Paul


PJ Palak Jain March 18, 2010 02:31 PM UTC

I am doing the same thing. Can I have a look at the sample?

Thanks,
Palak.


JB Jaffersathick B Syncfusion Team March 24, 2010 06:07 AM UTC

Hi Palak Jain,


Thank you for your interest in Syncfusion products.


Sorry for the delay in getting back to you. We will have a follow up of for this forum in the Direct Trac incident id #66081.


Regards,
Jaffer.B


DK Dennis Kuhn October 19, 2010 08:01 PM UTC

Hello, I have the same Problem, can you please send me your sample?



VK Vijayabharathi K Syncfusion Team October 20, 2010 07:26 AM UTC

Hi Dennis,

Thank you for your interest in Syncfusion products.

Please find the sample attached, which demonstrate the Multiple Y-axis with legend checkbox quires.

Let me know if you have any other concerns.

Regards,
Vijayabharathi K




MultipleYaxisSample_a3203946.zip

Loader.
Live Chat Icon For mobile
Up arrow icon