我正在使用WPF SciChart工具。我想将缩放功能绑定到按钮。用于放大和缩小。我阅读了所有的帮助和教程。他们有缩放历史绑定选项。但缩放本身就是鼠标滚动键。添加了代码。有一些方法可以在鼠标中单击并在图表上单击事件。但外面什么都没有。
<s:SciChartSurface s:ThemeManager.Theme="BrightSpark" Name="ChartSurface"
RenderableSeries="{s:SeriesBinding SeriesViewModels}" DockPanel.Dock="Bottom">
<s:SciChartSurface.XAxis>
<s:NumericAxis AxisTitle="Estimated Time [hh:mm:ss]"/>
</s:SciChartSurface.XAxis>
<s:SciChartSurface.YAxis>
<s:NumericAxis GrowBy="0.1, 0.1" AxisAlignment="Left" AxisTitle="Temperature [°C]"/>
</s:SciChartSurface.YAxis>
<s:SciChartSurface.ChartModifier>
<s:ModifierGroup>
<!-- Allow drag to zoom on Left mouse -->
<s:RubberBandXyZoomModifier ExecuteOn="MouseLeftButton"
RubberBandFill="#33FFFFFF" RubberBandStroke="#AAFFFFFF"
RubberBandStrokeDashArray="2 2" IsXAxisOnly="True" />
<s:MouseWheelZoomModifier ActionType="Zoom" XyDirection="XDirection"/>
<!-- Allow pan on Right mouse drag -->
<s:ZoomPanModifier ExecuteOn="MouseRightButton" ClipModeX="None" />
<!-- Allow Dragging YAxis to Scale -->
<s:YAxisDragModifier DragMode="Scale"/>
<!-- Allow Dragging XAxis to Pan -->
<s:XAxisDragModifier DragMode="Pan"/>
<!-- Allow Mousewheel Zoom -->
<s:MouseWheelZoomModifier/>
<!-- Allow Zoom to Extents on double click -->
<s:ZoomExtentsModifier ExecuteOn="MouseDoubleClick" />
</s:ModifierGroup>
</s:SciChartSurface.ChartModifier>
</s:SciChartSurface>