Quantcast
Channel: OxyPlot (moved to GitHub)
Viewing all articles
Browse latest Browse all 2061

New Post: few changes to the source and one potential issue found

$
0
0
Hi objo,
Thanks for the updated code, your changes are much elegant by moving the single point handling to a separate method.

As for #1 (resolution), I simply added a Resolution property to LineSeries and pass it along to RenderingExtensions.DrawMarkers.
            if (this.MarkerType != MarkerType.None)
            {
                rc.DrawMarkers(
                    pointsToRender, 
                    clippingRect, 
                    this.MarkerType, 
                    this.MarkerOutline, 
                    new[] { this.MarkerSize }, 
                    this.MarkerFill, 
                    this.MarkerStroke, 
                    this.MarkerStrokeThickness,
                    this.Resolution); // added Resolution property and pass it to draw markers
            }
Some background on my intention: I realize the 100K performance test is only good for non-markers line series. When there is markers, the performance degraded drastically due to markers drawing, obviously markers drawing requires much heavier processing than simple line drawing. Hence I try to reduce the number of markers when they overlapped, which is what DrawMarkers resolution argument is doing. Honestly the resolution method that I use (resolution 5) is just slight better than the original code, still not good enough for my application but I will look at possible way to improve that later.


I was considering handling in application code, but found DrawMarkers method to be resolution capable, so i just reuse it. After take a look at MinimumSegmentLeght, it is mainly to optimize line drawing, the markers drawing is not affected by this property, if I read it correctly... But I do see that I can use ScreenPointHelper.ResamplePoints to get resample screenpoints and pass it to DrawMarkers, what do you think?

Viewing all articles
Browse latest Browse all 2061

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>