Under review

Failed Implementation of Custom/Absolute StairStep Series

Oystein Bjorke 5 years ago updated 5 years ago 2
(copied from https://github.com/oxyplot/oxyplot/issues/395)

Camuvingian commented 20 hours ago
I am attempting to create a new plot type in OxyPlot. I essentally need a StairStepSeries, but with any negative values replaces by their Math.Abs value and when this occurs, the line style to reflect this has happened (by using color and or LineStyle). So, to highlight what I want
To do this, I have created the two classes (I have pasted actual code used below). This is conceptually easy when you know the tools you are working with, which I don't. My problem is directly related to my improper use of rectangle.DrawClippedLineSegments(). I can get a standard StairStepSeries plotting (copying the internal code) but when I attempt to use the rectangle.DrawClippedLineSegments()intuatively I realise I have not got a clue what this method does or how it is supposed to be used, but can't find any documentation. What is rectangle.DrawClippedLineSegments() doing and how should this method be used?
Any help anyone can provide (esp. changes or ammendments to my non-working class), it would be most appreciated. Thanks for your time.
Under review
The `DrawClippedLineSegments` extension method on `IRenderContext` does the same thing as `IRenderContext.DrawLineSegments`, but applies a clipping rectangle to the output. The clipping is done by OxyPlot, not by the graphics system implemented in the render context. 

The `DrawLineSegments` method draws line segments from point 0 to 1, point 2 to 3 and so on.

I think `rectangle.DrawClippedLineSegments` should be replaced by `renderContext.DrawClippedLineSegments` in your post.
I tried to improve the comments on the methods a little bit.