Jump to content
Software FX Community

Hide axes and legendbox


KRO

Recommended Posts

Hi

I am trying to hide all the axes and the legendbox. With the following lines of code:

 

foreach (var serie in testChart.Series){serie.AxisY.Visibility = System.Windows.Visibility.Collapsed;}

testChart.LegendBox.Visibility = System.Windows.Visibility.Collapsed;

 I got a chart with multiple series and 3 Y-axis (1 near and 2 far). If i check all series, then the third y-axis leaves a gap. It looks like it doesn't collapse the title area.

When i try to show the axis again, see the code line below: 

testChart.LegendBox.Visibility = System.Windows.Visibility.Visible;

foreach (var serie in testChart.Series){

serie.AxisY.Visibility = serie.Visibility;

}

testChart.UpdateLayout();

 It does not show the axis, only the label.

How do i collapse all the axis with titles?

How do i show all the series with axes, so that my checkbox legends still work?

Regards,

KRO 

Link to comment
Share on other sites

  • 4 weeks later...
  • 2 weeks later...

Hi

I tried your example, and can't seem to reproduce it either. I must have something to do with our complex setup.We have a lot of logic creating axis and series dynamically. I will try to reproduce it in a simpler setup (if possible).

/KRO

Link to comment
Share on other sites

Hi

I finally managed to reproduce it.Try to hide a serie by clicking at it. And the use the buttons to hide/show all axis+legendbox.

Look at the title at the axis. Eg. try to hide the first one, click the hide button, then show all. And watch axisY0.

/KRO

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...