File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed
Zoom_WPF_Chart_Inside_ScrollViewer Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change 1212 <local : ViewModel />
1313 </Window .DataContext>
1414
15- <ScrollViewer Margin =" 30" VerticalScrollBarVisibility =" Visible" HorizontalScrollBarVisibility =" Hidden" >
15+ <local : ScrollViewerExt Margin =" 30" VerticalScrollBarVisibility =" Visible" HorizontalScrollBarVisibility =" Hidden" >
1616 <StackPanel >
1717 <chart : SfChart x : Name =" chart" Header =" 2018 Sales" >
1818 <chart : SfChart .Legend>
7474 <chart : BarSeries XBindingPath =" Name" YBindingPath =" Sales" ItemsSource =" {Binding Data}" ShowTooltip =" True" />
7575 </chart : SfChart >
7676 </StackPanel >
77- </ScrollViewer >
77+ </local : ScrollViewerExt >
7878
7979</Window >
Original file line number Diff line number Diff line change @@ -31,8 +31,7 @@ public class ScrollViewerExt: ScrollViewer
3131 {
3232 protected override void OnMouseWheel ( MouseWheelEventArgs e )
3333 {
34- //Handle the mouse event for chart to avoid vertical scrolling with mouse wheel.
35- //You can just use the scrollbar thumb to achieve vertical scrolling
34+ // To restrict scroll action on chart
3635 if ( e . Source is SfChart )
3736 return ;
3837
You can’t perform that action at this time.
0 commit comments