更改缩放矩形的颜色

问题描述 投票:-2回答:1

我在我的应用程序中使用OxyPlot。我想在标记缩放区域时更改矩形的颜色。

我刚用Controller绑定鼠标左键进行缩放:

ChartController = new PlotController(); 
ChartController.BindMouseDown(OxyMouseButton.Left,PlotCommands.ZoomRectangle);
wpf oxyplot
1个回答
1
投票

要在Oxyplot中着色缩放矩形,您可以自定义ZoomRectangleTemplate。

例如,

<oxy:PlotView Model="{Binding MyModel}" Controller="{Binding ChartController,UpdateSourceTrigger=PropertyChanged}">
        <oxy:PlotView.ZoomRectangleTemplate>
            <ControlTemplate>
                <Border BorderBrush="Black" BorderThickness="1">
                    <Rectangle Fill="Orange" />
                </Border>
            </ControlTemplate>
        </oxy:PlotView.ZoomRectangleTemplate>
</oxy:PlotView>

这将为您提供所需的输出

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.