Skip to content

Commit

Permalink
Update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
martinivanoff committed Dec 18, 2018
1 parent aaeaa6e commit 2047d43
Show file tree
Hide file tree
Showing 56 changed files with 2,819 additions and 10 deletions.
116 changes: 116 additions & 0 deletions ChartView/WPF/ChartView_WPF.sln
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AxisLikeAnnotations", "Axis
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ErrorBars", "ErrorBars\ErrorBars.csproj", "{3DCF18D5-6A82-4861-85C7-7F177E3D6828}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataVirtualization", "DataVirtualization\DataVirtualization.csproj", "{3529A289-59B7-49F8-A306-3AA51BBC53B4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug.NoXaml|Any CPU = Debug.NoXaml|Any CPU
Expand Down Expand Up @@ -3666,6 +3668,120 @@ Global
{3DCF18D5-6A82-4861-85C7-7F177E3D6828}.ReleaseTrial451|Mixed Platforms.Build.0 = Release|Any CPU
{3DCF18D5-6A82-4861-85C7-7F177E3D6828}.ReleaseTrial451|x86.ActiveCfg = Release|Any CPU
{3DCF18D5-6A82-4861-85C7-7F177E3D6828}.ReleaseTrial451|x86.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug.NoXaml|Any CPU.ActiveCfg = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug.NoXaml|Any CPU.Build.0 = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug.NoXaml|Mixed Platforms.ActiveCfg = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug.NoXaml|Mixed Platforms.Build.0 = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug.NoXaml|x86.ActiveCfg = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug.NoXaml|x86.Build.0 = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug|x86.ActiveCfg = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug|x86.Build.0 = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug45.NoXaml|Any CPU.ActiveCfg = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug45.NoXaml|Any CPU.Build.0 = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug45.NoXaml|Mixed Platforms.ActiveCfg = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug45.NoXaml|Mixed Platforms.Build.0 = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug45.NoXaml|x86.ActiveCfg = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug45.NoXaml|x86.Build.0 = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug45|Any CPU.ActiveCfg = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug45|Any CPU.Build.0 = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug45|Mixed Platforms.ActiveCfg = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug45|Mixed Platforms.Build.0 = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug45|x86.ActiveCfg = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug45|x86.Build.0 = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug451.NoXaml|Any CPU.ActiveCfg = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug451.NoXaml|Any CPU.Build.0 = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug451.NoXaml|Mixed Platforms.ActiveCfg = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug451.NoXaml|Mixed Platforms.Build.0 = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug451.NoXaml|x86.ActiveCfg = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug451.NoXaml|x86.Build.0 = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug451|Any CPU.ActiveCfg = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug451|Any CPU.Build.0 = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug451|Mixed Platforms.ActiveCfg = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug451|Mixed Platforms.Build.0 = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug451|x86.ActiveCfg = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug451|x86.Build.0 = Debug|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release.NoXaml|Any CPU.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release.NoXaml|Any CPU.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release.NoXaml|Mixed Platforms.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release.NoXaml|Mixed Platforms.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release.NoXaml|x86.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release.NoXaml|x86.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release|Any CPU.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release|x86.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release|x86.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release45.NoXaml|Any CPU.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release45.NoXaml|Any CPU.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release45.NoXaml|Mixed Platforms.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release45.NoXaml|Mixed Platforms.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release45.NoXaml|x86.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release45.NoXaml|x86.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release45|Any CPU.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release45|Any CPU.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release45|Mixed Platforms.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release45|Mixed Platforms.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release45|x86.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release45|x86.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release451.NoXaml|Any CPU.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release451.NoXaml|Any CPU.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release451.NoXaml|Mixed Platforms.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release451.NoXaml|Mixed Platforms.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release451.NoXaml|x86.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release451.NoXaml|x86.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release451|Any CPU.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release451|Any CPU.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release451|Mixed Platforms.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release451|Mixed Platforms.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release451|x86.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release451|x86.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseNoCA|Any CPU.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseNoCA|Any CPU.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseNoCA|Mixed Platforms.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseNoCA|Mixed Platforms.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseNoCA|x86.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseNoCA|x86.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial.NoXaml|Any CPU.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial.NoXaml|Any CPU.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial.NoXaml|Mixed Platforms.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial.NoXaml|Mixed Platforms.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial.NoXaml|x86.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial.NoXaml|x86.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial|Any CPU.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial|Any CPU.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial|Mixed Platforms.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial|Mixed Platforms.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial|x86.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial|x86.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial45.NoXaml|Any CPU.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial45.NoXaml|Any CPU.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial45.NoXaml|Mixed Platforms.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial45.NoXaml|Mixed Platforms.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial45.NoXaml|x86.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial45.NoXaml|x86.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial45|Any CPU.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial45|Any CPU.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial45|Mixed Platforms.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial45|Mixed Platforms.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial45|x86.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial45|x86.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial451.NoXaml|Any CPU.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial451.NoXaml|Any CPU.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial451.NoXaml|Mixed Platforms.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial451.NoXaml|Mixed Platforms.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial451.NoXaml|x86.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial451.NoXaml|x86.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial451|Any CPU.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial451|Any CPU.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial451|Mixed Platforms.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial451|Mixed Platforms.Build.0 = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial451|x86.ActiveCfg = Release|Any CPU
{3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial451|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
9 changes: 9 additions & 0 deletions ChartView/WPF/DataVirtualization/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Application x:Class="DataVirtualization.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:DataVirtualization"
StartupUri="MainWindow.xaml">
<Application.Resources>

</Application.Resources>
</Application>
16 changes: 16 additions & 0 deletions ChartView/WPF/DataVirtualization/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;

namespace DataVirtualization
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}
}
105 changes: 105 additions & 0 deletions ChartView/WPF/DataVirtualization/ChartDataVirtualizationViewModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
using System;
using System.Collections.ObjectModel;
using System.Linq;
using Telerik.Windows.Controls;

namespace DataVirtualization
{
public class ChartDataVirtualizationViewModel : ViewModelBase
{
private const int FullDataCount = 1000000;
private const double RangeOffset = 0.01;
private static Random randomNumberGenerator = new Random();

private ObservableCollection<PlotInfo> fullData;
private ObservableCollection<PlotInfo> visibleData;
private double minimumX;
private double maximumX;

public ChartDataVirtualizationViewModel()
{
this.fullData = this.GenerateFullData();
this.MinimumX = this.fullData.FirstOrDefault().XValue;
this.MaximumX = this.fullData.LastOrDefault().XValue;
this.visibleData = new ObservableCollection<PlotInfo>();
}

public double MinimumX
{
get { return this.minimumX; }
set
{
if (this.minimumX != value)
{
this.minimumX = value;
this.OnPropertyChanged("MinimumX");
}
}
}

public double MaximumX
{
get { return this.maximumX; }
set
{
if (this.maximumX != value)
{
this.maximumX = value;
this.OnPropertyChanged("MaximumX");
}
}
}

public ObservableCollection<PlotInfo> FullData
{
get { return this.fullData; }
}

public ObservableCollection<PlotInfo> VisibleData
{
get { return this.visibleData; }
private set
{
if (this.visibleData != value)
{
this.visibleData = value;
this.OnPropertyChanged("VisibleData");
}
}
}

public void UpdateVisibleData(double minimum, double maximum)
{
double delta = maximum - minimum;
double offset = delta * RangeOffset;
double offsetMinimum = minimum - offset;
double offsetMaximum = maximum + offset;

this.VisibleData = this.GetVisibleItems(offsetMinimum, offsetMaximum);
}

private ObservableCollection<PlotInfo> GetVisibleItems(double minimum, double maximum)
{
ObservableCollection<PlotInfo> result = new ObservableCollection<PlotInfo>();
for (int i = 0; i < this.fullData.Count; i++)
{
PlotInfo info = this.fullData[i];
if (minimum <= info.XValue && info.XValue <= maximum)
{
result.Add(info);
}
}
return result;
}

private ObservableCollection<PlotInfo> GenerateFullData()
{
ObservableCollection<PlotInfo> result = new ObservableCollection<PlotInfo>();
for (int i = 0; i < FullDataCount; i++)
{
result.Add(new PlotInfo() { XValue = i, YValue = randomNumberGenerator.Next(100, 300) });
}
return result;
}
}
}
Loading

0 comments on commit 2047d43

Please sign in to comment.