Skip to content

Commit 523b913

Browse files
Modified the comment content
1 parent 2b4db72 commit 523b913

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

Zoom_WPF_Chart_Inside_ScrollViewer/MainWindow.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
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>
@@ -74,6 +74,6 @@
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>

Zoom_WPF_Chart_Inside_ScrollViewer/MainWindow.xaml.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)