IsAxisVisible property not working when binding to Model

Oystein Bjorke 10 років тому 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:Plot.Axes>
                                <oxy:DateTimeAxis Position="Bottom" 
                                                  StringFormat="hh:mm:ss" 
                                                  IsAxisVisible="false" 
                                                  Maximum="{Binding PlotTimeMax}" 
                                                  Minimum="{Binding PlotTimeMin}"/>
                                <oxy:LinearAxis Position="Left" IsAxisVisible="false"/>
                            </oxy:Plot.Axes>
                        </oxy:Plot>
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:Plot.Axes>
                                <oxy:DateTimeAxis Position="Bottom" StringFormat="hh:mm:ss"/>
                                <oxy:LinearAxis Position="Left" IsAxisVisible="True"/>
                            </oxy:Plot.Axes>
                            <oxy:LineSeries ItemsSource="{Binding PartsPerHourDataPoints}"/>
                        </oxy:Plot>

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 https://oxyplot.codeplex.com/workitem/10222, I think this should generate a runtime error (exception).
See also https://oxyplot.codeplex.com/workitem/10128

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.