SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components

Welcome to the SciChart Community Forums!

Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy. We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!

Please note: SciChart team will only answer questions from customers with active support subscriptions. Expired support questions will be ignored. If your support status shows incorrectly, contact us and we will be glad to help.

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.