3

I have those settings for a Plotmodel

myModel = new PlotModel();
myModel.IsLegendVisible = false;
myModel.Title = "";
plotView1.Model = myModel;
myModel.Axes[0].AbsoluteMaximum = Gesamt;
myModel.Axes[0].AbsoluteMinimum = 0;
myModel.Axes[0].IsAxisVisible = false;
myModel.Axes[0].Position = AxisPosition.Bottom;
myModel.Axes[0].IsZoomEnabled = true;
myModel.Axes[0].IsPanEnabled = true;
myModel.Axes[1].AbsoluteMaximum = 10;
myModel.Axes[1].AbsoluteMinimum = 0;
myModel.Axes[1].IsAxisVisible = false;
myModel.Axes[1].Position = AxisPosition.Left;
myModel.Axes[1].IsZoomEnabled = true;
myModel.Axes[1].IsPanEnabled = true;
myModel.PlotAreaBorderColor = OxyColors.Transparent;
myModel.InvalidatePlot(true);

Now I cannot zoom and pan using the mouse

If I change myModel.Axes[0].IsAxisVisible and myModel.Axes[1].IsAxisVisible to true, it shows the axes as expected, but this time I can zoom and pan.

How to hide them while still being able to zoom and pan?

Alex
  • 117
  • 11

1 Answers1

0

You can let IsAxisVisible to true and set all these properties to transparent :

myModel.Axes[0].TicklineColor = OxyColors.Transparent;
myModel.Axes[0].MajorGridlineColor = OxyColors.Transparent;
myModel.Axes[0].AxislineColor = OxyColors.Transparent;
myModel.Axes[0].ExtraGridlineColor = OxyColors.Transparent;
myModel.Axes[0].MinorGridlineColor = OxyColors.Transparent;
myModel.Axes[0].MinorTicklineColor = OxyColors.Transparent;
myModel.Axes[0].TextColor = OxyColors.Transparent;
myModel.Axes[0].TitleColor = OxyColors.Transparent;

myModel.Axes[1].TicklineColor = OxyColors.Transparent;
myModel.Axes[1].MajorGridlineColor = OxyColors.Transparent;
myModel.Axes[1].AxislineColor = OxyColors.Transparent;
myModel.Axes[1].ExtraGridlineColor = OxyColors.Transparent;
myModel.Axes[1].MinorGridlineColor = OxyColors.Transparent;
myModel.Axes[1].MinorTicklineColor = OxyColors.Transparent;
myModel.Axes[1].TextColor = OxyColors.Transparent;
myModel.Axes[1].TitleColor = OxyColors.Transparent;