I have a RadCartesianChart with one ScatterPointSeries when the number of points is 20000 the time to plot is 40 seconds.
The class where stored values:
public
class
ChartDataFlatness
{
public
double
XValue {
get
;
set
; }
public
double
YValue {
get
;
set
; }
public
Brush Brush {
get
;
set
; }
}
The class used to pass value to RadCartesianChart
class
ViewModelFlatness : ViewModelBase
{
private
List<ChartDataFlatness> data;
public
ViewModelFlatness() { }
public
List<ChartDataFlatness> Data {
get
{
return
this
.data; }
set
{
if
(
this
.data != value) {
this
.data = value;
this
.OnPropertyChanged(
"Data"
);
}
}
}
}
The user control used for show the data:
<
UserControl
x:Class
=
"TiQ.Qua.Tna.Quality.Station.UserControls.UserControlChartFlatnessQualityStation"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
xmlns:classes
=
"clr-namespace:TiQ.Qua.Tna.Quality.Station.Classes"
mc:Ignorable
=
"d"
RenderTransformOrigin
=
"0,0"
HorizontalAlignment
=
"Left"
VerticalAlignment
=
"Top"
>
<
Grid
>
<
telerik:RadCartesianChart
x:Name
=
"RadChartFlatness"
LayoutUpdated
=
"RadChartFlatness_LayoutUpdated"
>
<
telerik:ScatterPointSeries
XValueBinding
=
"XValue"
YValueBinding
=
"YValue"
>
<
telerik:ScatterPointSeries.PointTemplate
>
<
DataTemplate
>
<
Rectangle
Width
=
"10"
Height
=
"10"
Fill
=
"{Binding DataItem.Brush}"
/>
</
DataTemplate
>
</
telerik:ScatterPointSeries.PointTemplate
>
</
telerik:ScatterPointSeries
>
<
telerik:RadCartesianChart.HorizontalAxis
><
telerik:LinearAxis
VerticalLocation
=
"Top"
/></
telerik:RadCartesianChart.HorizontalAxis
>
<
telerik:RadCartesianChart.VerticalAxis
><
telerik:LinearAxis
IsInverse
=
"True"
/></
telerik:RadCartesianChart.VerticalAxis
>
</
telerik:RadCartesianChart
>
</
Grid
>
</
UserControl
>
The code used to set data for RadGraph:
ViewModelFlatness _viewModel =
new
ViewModelFlatness { };
// Set Data of _viewModel
RadChartFlatness.Series[0].ItemsSource = _viewModel.Data;
It is possibile to reduce the time to plot data to 2/5 seconds.
Greetings,
Paolo​