Hi !
I'm trying telerik charts and I wanted to test the performance. I saw the sample with 15000 points and I wanted to do the same with much more. Unfortunately, my computer got very hard to print a 10000 points line. I guess something is wrong with my code compared to the sample one but I don't really realise what.
Does someone have an idea ?
Thank you !
Edit : It does the same without PointTemplate
I'm trying telerik charts and I wanted to test the performance. I saw the sample with 15000 points and I wanted to do the same with much more. Unfortunately, my computer got very hard to print a 10000 points line. I guess something is wrong with my code compared to the sample one but I don't really realise what.
class
DataListViewModel : ViewModelBase
{
private
RadObservableCollection<
int
> dataList;
private
Random random =
new
Random((
int
) DateTime.Now.Ticks);
public
DataListViewModel()
{
this
.Data =
this
.FillRandomlyList();
}
public
RadObservableCollection<
int
> Data
{
get
{
return
dataList; }
set
{
if
(value != dataList)
{
dataList = value;
this
.OnPropertyChanged(
"Data"
);
}
}
}
private
RadObservableCollection<
int
> FillRandomlyList()
{
var res =
new
RadObservableCollection<
int
>();
for
(
int
i = 0; i < 10000; i++)
{
res.Add(random.Next(500));
}
return
res;
}
}
<
Window
x:Class
=
"PerfTest.MainWindow"
Title
=
"MainWindow"
Height
=
"350"
Width
=
"525"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
>
<
Grid
>
<
telerik:RadCartesianChart
Margin
=
"12,12,270,12"
>
<
telerik:RadCartesianChart.Grid
>
<
telerik:CartesianChartGrid
MajorLinesVisibility
=
"XY"
MajorXLineDashArray
=
"5, 5"
MajorYLineDashArray
=
"5, 5"
>
<
telerik:CartesianChartGrid.MajorXLineStyle
>
<
Style
TargetType
=
"Line"
>
<
Setter
Property
=
"Shape.Stroke"
Value
=
"Gray"
/>
</
Style
>
</
telerik:CartesianChartGrid.MajorXLineStyle
>
<
telerik:CartesianChartGrid.MajorYLineStyle
>
<
Style
TargetType
=
"Line"
>
<
Setter
Property
=
"Shape.Stroke"
Value
=
"Gray"
/>
</
Style
>
</
telerik:CartesianChartGrid.MajorYLineStyle
>
</
telerik:CartesianChartGrid
>
</
telerik:RadCartesianChart.Grid
>
<
telerik:RadCartesianChart.HorizontalAxis
>
<
telerik:LinearAxis
Visibility
=
"Hidden"
/>
</
telerik:RadCartesianChart.HorizontalAxis
>
<
telerik:RadCartesianChart.VerticalAxis
>
<
telerik:CategoricalAxis
Title
=
"Test2"
Visibility
=
"Visible"
IsInverse
=
"True"
/>
</
telerik:RadCartesianChart.VerticalAxis
>
<
telerik:RadCartesianChart.Behaviors
>
<
telerik:ChartPanAndZoomBehavior
/>
<
telerik:ChartSelectionBehavior
/>
</
telerik:RadCartesianChart.Behaviors
>
<
telerik:RadCartesianChart.Series
>
<
telerik:LineSeries
Stroke
=
"IndianRed"
CategoryBinding
=
"X"
ValueBinding
=
"Y"
ItemsSource
=
"{Binding Path=Data}"
RenderMode
=
"Light"
>
<
telerik:LineSeries.PointTemplate
>
<
DataTemplate
>
<
Ellipse
Fill
=
"DeepPink"
Height
=
"5"
Width
=
"5"
/>
</
DataTemplate
>
</
telerik:LineSeries.PointTemplate
>
</
telerik:LineSeries
>
</
telerik:RadCartesianChart.Series
>
</
telerik:RadCartesianChart
>
</
Grid
>
</
Window
>
Does someone have an idea ?
Thank you !
Edit : It does the same without PointTemplate