Pre loader

Default automatic coloring of Series

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

0
0

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.

Version
4.2.0.9002
  • You must to post comments
0
0

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

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies