c# - 隐藏轴,同时仍然能够缩放和平移
问题描述
我有这些设置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].IsAxisVisible
and更改myModel.Axes[1].IsAxisVisible
为true
,它会按预期显示轴,但这次我可以缩放和平移。
如何在仍然能够缩放和平移的同时隐藏它们?
解决方案
您可以让IsAxisVisible为 true 并将所有这些属性设置为 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;
推荐阅读
- javascript - 拒绝加载脚本,因为它违反了以下内容安全策略指令
- sql - 需要帮助删除 SQL 中的重复项
- tensorflow - 什么是 tensorflow.python.data.ops.dataset_ops.PrefetchDataset?
- python - 如何插入 tkinter 文本小部件
- python - 在 matplotlib 中修改子图
- c# - 模型 提交表单时仅给定场景所需的值
- wordpress - 无法创建新帖子 | WordPress API | 骨干JS | 无法读取未定义的属性“应用”
- spring-boot - 如何确定用户配置了哪个 OAuth2ResourceServer 流
- mysql - mysql连接器没有下载
- python - 在 Airflow 的电子邮件正文中发送 HTML 表格