IsAxisVisible property not working when binding to Model

Oystein Bjorke 6 years ago 0
This discussion was imported from CodePlex

sargent wrote at 2014-06-16 04:26:

I'm using WPF and I have created my PlotModel in the ViewModel which I am binding to from XAML. However, when I do this the IsAxisVisible property does not function. The axis is always visible whether the property is set to true or false.

IsAxisVisible not working

<oxy:Plot Width="600" Height="200" Margin="0" Model="{Binding UserPlotModel}">
                                <oxy:DateTimeAxis Position="Bottom" 
                                                  Maximum="{Binding PlotTimeMax}" 
                                                  Minimum="{Binding PlotTimeMin}"/>
                                <oxy:LinearAxis Position="Left" IsAxisVisible="false"/>
In other plots where I am binding through the ItemSource the IsAxisVisible property works fine. It appears to be an isolated case when binding to Model. Am I doing something wrong or is there a work around for this?

IsAxisVisible Working

  <oxy:Plot Width="600" Height="200" Margin="0">
                                <oxy:DateTimeAxis Position="Bottom" StringFormat="hh:mm:ss"/>
                                <oxy:LinearAxis Position="Left" IsAxisVisible="True"/>
                            <oxy:LineSeries ItemsSource="{Binding PartsPerHourDataPoints}"/>

objo wrote at 2014-06-16 09:59:

The Model property should override all the properties and collections (annotations, axes, series) of the PlotView, so I think this is working as intended.
But I have created, I think this should generate a runtime error (exception).
See also

sargent wrote at 2014-06-19 03:57:

Is there a way to create a RectangleBarSeries without using the Model property? I've been experimenting but haven't found a way around this issue.