Thank you for the attached code snippets. I was able to create a small project based on your code.
When I ran the project initially, it took about 5.6 seconds for the chart to display. There are several reasons why it took so much time.
The main reason is that when you have 20 thousand items in the source, the chart creates 20 thousand visuals to display these items. When you use a point template, the number is actually more - 40 thousand visuals, because there is a ContentPresenter for each point and in the template you have one more visual - the Rectangle. These 40 thousand visuals are pretty heavy for any wpf app, you can see this if you create a brand new project and put in 40 thousand Path elements.
The first step to making the chart faster is not to use a PointTemplate. The number of visuals is smaller now and on my machine it rendered for 4.3 seconds. Still not good.
By default the chart uses Path elements to plot its points in a point series, but you can switch to a lighter render mode
, such as Bitmap or Direct2D. I did that and now the chart loads instantly. However, the points do not have the desired color and are not rects anymore, they are circles.
We can get the separate brushes of the items easily, by using a style selector - DefaultVisualStyleSelector property of the series. I have demonstrated this in the project I am sending where you will see the CustomStyleSelector.
Unfortunately, presently there is no way to bring the rects back. The light rendering has some limitations, one of which is not being able to choose the shape, it is always the default round point.
I hope this was helpful.
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Telerik Feedback Portal
and vote to affect the priority of the items