mrsargent
mrsargent

Reputation: 2442

Oxyplot IsAxisVisible RectangleBarSeries

I am creating a RectangleBarSeries plot with Oxyplot. I need my DateTimeAxis not to be visible by using

IsAxisVisible = false.

The only way I know how to make a RectangleBarSeries plot is by using the model property. When the model property is used it overridess all properties and collections. This means by setting the IsAxisVisible = false is not doing anything. Is there any other way to make a RectangleBarSeries plot without using the Model property so that I can make my axis invisible?

Below is the current code I am using that does not make the axis invisible.

  <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>

Upvotes: 2

Views: 609

Answers (1)

RagedMilkMan
RagedMilkMan

Reputation: 425

I believe you want something like this

public static void SetHiddenAxis(PlotModel yourPlotModel)
{
    var LeftAxis = new LinearAxis();
    LeftAxis.Position = AxisPosition.Left;
    LeftAxis.IsAxisVisible = false;
    yourPlotModel.Axes.Add(LeftAxis);
}

Upvotes: 1

Related Questions