Hello,
I was wondering if there’s a way (other than creating a chart modifier) of passing a collection of colors and let the scichart surface automatically color series when they are added based on the collection of colors sent.
If it’s not the case, is there a place in a ChartModifier other than the OnLoaded event handler where I am guaranteed that the ParentSurface property is not null and no renderable series have been loaded yet?
Thank you very much.
Regards,
Sebastian.
- You must login to post comments
Hi Sebastian,
We do something similar to this in our ‘Create 500×500 series examples‘ by making an attached behaviour to instantiate series from ViewModels.
The class that does this is LineSeriesSource.cs found in the example code above.
Unfortunately it doesn;t use our standard MVVM API but sort of creates its own. I would suggest maybe assigning RenderableSeries.Stroke to RenderableSeries via RelativeSource Self Binding and using a converter to convert SciChartSurface.RenderableSeries.IndexOf(renderSeries) to a color.
Sort of like this:
<s:FastLineRenderableSeries Stroke="{Binding RelativeSource={RelativeSource Self}, Converter={StaticResource IndexOfRenderSeriesToColorConverter}}/>
where the IndexOfRenderSeriesToColorConverter is a converter that accepts IRenderableSeries as input value, gets the parent scichartsurface, gets index on it and returns a color.
Does that help? It’s the best auto-coloring advice we have at the moment!
Best regards,
Andrew
- Andrew Burnett-Thompson answered 7 years ago
- You must login to post comments
Please login first to submit.