【问题标题】:Hide axes while still being able to zoom and pan隐藏轴,同时仍然能够缩放和平移
【发布时间】:2020-03-03 15:36:05
【问题描述】:

我有 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);

现在我无法使用鼠标进行缩放和平移

如果我将myModel.Axes[0].IsAxisVisiblemyModel.Axes[1].IsAxisVisible 更改为true,它会按预期显示轴,但这次我可以缩放和平移。

如何在仍然能够缩放和平移的同时隐藏它们?

【问题讨论】:

    标签: c# winforms oxyplot


    【解决方案1】:

    您可以让 IsAxisVisible 为 true 并将所有这些属性设置为透明:

    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;
    

    【讨论】:

      猜你喜欢
      • 2013-06-29
      • 2022-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多