Hi,
Been following this doc to color FastLineRenderableSeries datapoints but my series won’t show. Here is my OverrideStrokeColor after implementing the Interface
public Color? OverrideStrokeColor(IRenderableSeries rSeries, int index, IPointMetadata metadata)
{
ColorMetadata colorMetadata = metadata as ColorMetadata;
if(colorMetadata == null)
return null;
switch (colorMetadata.Color.ToLower().Trim())
{
case: blah blah
return Colors.blahblah
default:
return null;
}
}
And the metadata class
public class ColorMetadata : IPointMetadata
{
public string Color {get; set; }
public ColorMetadata(string color)
{
Color = color;
}
public bool IsSelected { get; set; }
public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
}
And the series
<s:FastLineRenderableSeries Stroke="Green"
StrokeThickness="1"
PaletteProvider="{StaticResource pointColorProvider}"
DataSeries="{Binding Source}">
Without forgetting (in UserControl.Resources)
<pointColorProvider:ColorPaletteProvider x:Key="pointColorProvider"/>
and appending each point with its metadata
like dataSeries.Append(Date, data, new ColorMetadata(“green”));
All works great (without paletteProvider) except when I introduce PaletteProvider=”{StaticResource pointColorProvider}”. Tried with breakpoints in my PaletteProvider class, only OnBeginSeriesDraw gets hit, OverrideStrokeColor is never hit. Please help.
- Kilosa Magali asked 7 years ago
-
Have you put a breakpoint in the PaletteProvider and can you determine if the line ‘return Colors.blahblah’ is hit? And is this color TRANSPARENT or null or a real color?
-
Yes, I have a break point on the first line of the method and the all the returns of the switch (including return Colors.blahblah), all are not hit. The method is not hit at all (Only OnBeginSeriesDraw is hit). The colors are real like Colors.Red.
- You must login to post comments
Please login first to submit.