选择 Silverlight Toolkit 图表中最近的点
我有一个 LineSeries 图表。通过series.IsSelectionEnabled = true;
,当我将鼠标移到这些点上时,我可以选择该节点。但是,当鼠标未完全位于该点上方而是接近该点(上方或下方)时,我该怎么办?谢谢。
附: 还有一件事。当鼠标悬停在列上时,如何更改列的颜色,以便用户可以知道他/她要选择哪一列。
I have a LineSeries chart. By series.IsSelectionEnabled = true;
when I move the mouse over the points, I can select that node. But how can I do it when the mouse is not exactly over the point but when it's near it (above or under)? Thanks.
PS:
One more thing. How can I change the color of the column when the mouse is over it so the user can tell which one of the columns he/she is going to select.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我使用单个
LineSeries
创建了图表示例。您可以单击绘图上的任意位置,然后将选择最近的点。XAML(将
ItemsSource
属性和其他属性更改为您的属性):隐藏代码:
正如我所说,即使您在距离任何图表点很远的地方单击,该图表也会选择最近的点。如果这不是预期的行为,您可以取消注释这些行并以像素为单位设置任何数字:
我已经写了注释,但如果有不清楚的地方,您可以询问,我会解释。
I have created the example of the chart with the single
LineSeries
. You can click anywhere at the plot and the nearest point will be selected.XAML (Change the
ItemsSource
property and other properties to yours):Code-behind:
As I said this chart will select the nearest point even if you click at a great distance away from any chart point. If it isn't intended behavior, you can uncomment these lines and set any number in pixels:
I have written comments, but if something isn't clear you can ask and I will explain.