Skip to content

Update for WPF KB GitHub sample - KB 14567 #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 16, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# How-to-perform-lazy-loading-in-WPF-Chart-SfChart-
# How to perform lazy loading in WPF Chart SfChart
This sample demonstrates how to perform lazy loading in WPF Chart(SfChart).

Here's a step-by-step guide on how to perform lazy loading in a WPF Chart using the Syncfusion SfChart

## Step 1:
Initialize the SfChart with Primary and Secondary axis.

## Step 2:
Hook the PanChanged event in SfChart and set the required ZoomFactor on the primary axis.

Expand Down Expand Up @@ -35,10 +36,6 @@ XAML
chart.SecondaryAxis = yAxis;
this.Content = chart;





## Step 3 :
Initialize the ChartZoomPanBehavior and enable panning by setting EnablePanning to “True”.

Expand All @@ -57,7 +54,7 @@ Initialize the ChartZoomPanBehavior and enable panning by setting EnablePanning
## Step 4:
Implement the chart_PanChanged method to calculate the end range of the chart. As horizontal scrolling or panning reaches the end of the chart, additional data points are added, then adjust the position of the xAxis range using ZoomPosition.

### C#
### C#

**// startValue = You can set the last value of the data source in viewModel.**
private void chart_PanChanged(object sender, PanChangedEventArgs e)
Expand All @@ -82,5 +79,7 @@ Implement the chart_PanChanged method to calculate the end range of the chart. A
![LazyLoading_Output](https://github.com/SyncfusionExamples/How-to-perform-lazy-loading-in-WPF-Chart-SfChart/assets/113961867/8adee59a-dee8-43dc-8609-c4d529e80873)

## Troubleshooting

### Path too long exception
If you are facing a path too long exception when building this example project, close Visual Studio and rename the repository to short and build the project.

For more details, refer to the KB on [how to perform lazy loading in WPF Chart SfChart](https://support.syncfusion.com/kb/article/14567/how-to-perform-lazy-loading-in-wpf-chart-sfchart).
4 changes: 2 additions & 2 deletions SimpleSample/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
YBindingPath="YValue"
Stroke="#ff933d"
Interior="#FFF1D8"
EnableAnimation="True" Margin="-183,-4,182,4"
></syncfusion:SplineAreaSeries>
EnableAnimation="True">
</syncfusion:SplineAreaSeries>
<syncfusion:SfChart.Behaviors>
<syncfusion:ChartZoomPanBehavior EnablePanning="True" EnableDirectionalZooming="False" EnableMouseWheelZooming="False" EnablePinchZooming="False" EnableSelectionZooming="False"></syncfusion:ChartZoomPanBehavior>
</syncfusion:SfChart.Behaviors>
Expand Down
2 changes: 1 addition & 1 deletion SimpleSample/SimpleSample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net8.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
</PropertyGroup>
Expand Down