Page 1 of 1

PointLineSeries - highlight all samples < 0

Posted: Tue Sep 02, 2014 6:58 pm
by greggorob64
I'm representing a line whose value will sometimes (but infrequently) dip below zero.

I'd like to highlight this line segment by turning the trace red for just that value. Is this possible to do? I'm not sure mechanism to use to accomplish this.

Re: PointLineSeries - highlight all samples < 0

Posted: Tue Sep 02, 2014 7:10 pm
by ArctionPasi
You can do that with ValueRangePalette coloring of PointLineSeries, SampleDataSeries or FreeformPointLineSeries.
Line coloring with ValueRangePalette
Line coloring with ValueRangePalette
LineColoringWithPalette.jpg (133.32 KiB) Viewed 6800 times
Just set
- series.UsePalette = true
- series.ValueRangePalette.Type = Uniform
- In series.ValueRangePalette.Steps, define two steps. Red step with 0 value, and White step to 10000 or so.

Then the values below 0 are colored with red, and above that with white. You can add more steps in the palette too.

Re: PointLineSeries - highlight all samples < 0

Posted: Tue Sep 02, 2014 7:15 pm
by greggorob64
Thanks pasi!