Slow loading graphs using WPF

Oystein Bjorke 10 years ago 0
This discussion was imported from CodePlex

willmoore88 wrote at 2013-08-13 10:30:

Hi. I'm using Oxyplot in a WPF project and am finding that my graphs are taking a while to load / update once there is only a few hundred points in them.

I am plotting 1-4 scatter series onto a time / linear graph. The ItemsSource is set to a collection of DateValues - pretty much a copy of whats in one of the examples.

Any ideas why I'm experiencing this slow down?

everytimer wrote at 2013-08-13 20:07:

What MarkerType are you using? I've realized that the performance can vary noticeably. Try to use "Cross" in MarkerType. Good luck

willmoore88 wrote at 2013-08-14 09:02:

var lineSeries1 = new LineSeries("Cloud 1")
            {
                Color = OxyColors.Transparent,
                MarkerFill = OxyColors.Black,
                MarkerStroke = OxyColors.Black,
                MarkerType = MarkerType.Circle,
                MarkerSize = 1.5,
                StrokeThickness = 1,
                DataFieldX = "Date",
                DataFieldY = "Value1",
                ItemsSource = data
            };
            var lineSeries2 = new LineSeries("Cloud 2")
            {
                Color = OxyColors.Transparent,
                MarkerFill = OxyColors.Black,
                MarkerStroke = OxyColors.Black,
                MarkerType = MarkerType.Circle,
                MarkerSize = 1.5,
                StrokeThickness = 1,
                DataFieldX = "Date",
                DataFieldY = "Value2",
                ItemsSource = data
            };
            var lineSeries3 = new LineSeries("Cloud 3")
            {
                Color = OxyColors.Transparent,
                MarkerFill = OxyColors.Black,
                MarkerStroke = OxyColors.Black,
                MarkerType = MarkerType.Circle,
                MarkerSize = 1.5,
                StrokeThickness = 1,
                DataFieldX = "Date",
                DataFieldY = "Value3",
                ItemsSource = data
            };
            var lineSeries4 = new LineSeries("Cloud 4")
            {
                Color = OxyColors.Transparent,
                MarkerFill = OxyColors.Black,
                MarkerStroke = OxyColors.Black,
                MarkerType = MarkerType.Circle,
                MarkerSize = 1.5,
                StrokeThickness = 1,
                DataFieldX = "Date",
                DataFieldY = "Value4",
                ItemsSource = data
            };
            var lineSeries5 = new LineSeries("Vertical Visibility")
            {
                Color = OxyColors.Transparent,
                MarkerFill = OxyColors.Transparent,
                MarkerStroke = OxyColors.Blue,
                MarkerType = MarkerType.Square,
                MarkerSize = 1.5,
                StrokeThickness = 1,
                DataFieldX = "Date",
                DataFieldY = "Value5",
                ItemsSource = data
            };
Mainly circles, with only the occasional square. I'll give cross a go but I really need circles!