Line Series as a Gradient

Oystein Bjorke 10 year бұрын 0
This discussion was imported from CodePlex

Artiga wrote at 2013-09-26 16:01:

hello all!

I need a "gradient line series", i will pass as parameters, two colors and two points, the line will start in the first point with the color number one, and will finish at second point with the other color, but in the middle the color must change slowly, change as a gradient ....

I´m thinking in doing that using a lot of scatter points, and changing colors manually, but i don't think this is the best solution.

There another way to do that?

objo wrote at 2013-10-01 22:20:

You should create a custom series for this and override the Render method.
If you want to draw this as a line, you must call IRenderContext.DrawLine with many small line segments - each with a different color.
Use OxyColor.Interpolate to calculate the colors.