0
Answered
Scatter series points with different color
I'm trying to make a graph with a few points, with some that should be a different color based on whether they are "outliers" or not. Basically, I display scatter points, and if a property on the list I'm binding the ScatterSeries to is "true", then the color of the point should be red, otherwise it should be black.
I've tried using the
I've tried using the
LinearColorAxis
for this, but no luck yet. Here's the code (WPF) I have now:
<oxy:plot title="Repetitions"> <oxy:plot.axes> <oxy:linearcoloraxis key="Outliers" position="Right" minimum="0" maximum="1" highcolor="Red" lowcolor="Black"></oxy:linearcoloraxis> <oxy:linearaxis position="Bottom" title="Measurement"></oxy:linearaxis> <oxy:plot.series> <oxy:scatterseries itemssource="{Binding Item.Repetitions}" coloraxiskey="Outliers" datafieldx="RepetitionNbr" datafieldy="ExcessRayleighRatio" datafieldvalue="IsOutlierValue"></oxy:scatterseries> </oxy:plot.series> </oxy:plot.axes> </oxy:plot>The DataFieldValue does seem to be took (if I put a breakpoint in the property, I can see the binding working, the IsOutlierValue is a "double" property that returns 1.0 if I want the point "red", and 0.0 if I want it black. But the points don't change color.
Customer support service by UserEcho
Minimum=0.1
andMaximum=0.9
in yourLinearColorAxis
The
HighColor
is used for values above theMaximum
defined in the axis!Position = None
if you don't need to see the color axis.