0

WPF Linear and logarithmic axes ignore Visiblity property

wiyosaya 9 years ago updated 9 years ago 1
I declared three axes in wpf. One is a linear axis on the left, one is a linear axis on the bottom, and the third is a logarithmic axis on the bottom. I have different sets of data that I am using, and based on which set of data is shown at any particular time, I would like to hide one of the bottom axes. So, through a style, I set the appropriate axis to visible and the other to collapsed. The problem is that both of the bottom axes still show. I explicitly tried setting one of the axes to collapsed in xaml, leaving the other visible, and both axes still show.

I figure that I am either missing something, or that this is a bug.

Any thoughts on how to handle this?

Thanks.
OK - so another case where I lack understanding of how oxyplot works. I found out that there is a dependency property on the wpf Axis base class "IsAxisVisible". Each dependent axis uses this property to determine when it is rendered. Since this is a dependency property, it can be bound to and set in a style like I was attempting.

Personally, I find this confusing since the Series objects do not have a corresponding "IsSeriesVisible" property, and use the wpf base class "FrameworkElement" property "Visibility" to determine whether they are rendered.

I would have expected from a consistency standpoint that Axis would be the same - as is evidenced by my first post - especially since Axis exposes the FrameworkElement property "Visibility".

Anyway, I am glad that the source is available, otherwise, I may not have figured this out as easily as I did.