简体   繁体   English

放大/缩小图表控件DevExpress

[英]Zoom In/Out chart control DevExpress

I have a chart control inside a grid where there is a scrollviewer. 我在一个带有滚动查看器的网格内有一个图表控件。 A client need is to activate zoom on the chart control but when i use the mouse wheel on the chart control, except when i reach the limit on the grid scrollviewer, it's the grid scrollviewer who is scrolling. 客户需要激活图表控件上的缩放,但是当我在图表控件上使用鼠标滚轮时,除非我达到网格滚动查看器的限制,否则滚动的是网格滚动查看器。

I think there is a miss inside the devexpress control because on the native wpf control it's work. 我认为devexpress控件内部存在遗漏,因为在本机wpf控件上它可以工作。 Exemple list view. 示例列表视图。

Do you already have this issue? 你已经有这个问题了吗? Do you find the solution? 找到解决方案了吗?

    ChartControl cc = new ChartControl();

cc.Titles.Add(new DevExpress.Xpf.Charts.Title() { Content = "" });
cc.Legend = new DevExpress.Xpf.Charts.Legend();

DevExpress.Xpf.Charts.XYDiagram2D xy = new DevExpress.Xpf.Charts.XYDiagram2D();
xy.EnableAxisXNavigation = true;
xy.EnableAxisYNavigation = true;

To resolve this issue, implement custom mouse wheel processing by handling the ScrollViewer.PreviewMouseWheel event. 若要解决此问题,请通过处理ScrollViewer.PreviewMouseWheel事件来实现自定义鼠标滚轮处理。 Check this ticket for a sample project illustrating this approach (see the DXSample.zip archive). 查看票证以获取说明此方法的示例项目(请参阅DXSample.zip存档)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM