Pre loader

Replacement for `removeFromLegend` (iOS)

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

I’m updating some code that was written against SciChart iOS v2. We have one graph in that code that relied on removeFromLegend in a renderable series, to prevent the legend from getting ridiculous long.

As an example, suppose we have Western Earth, Western Wind, Western Fire, Eastern Earth, Eastern Wind, and Eastern Fire. Each element is styled the same, no matter where it’s located. In the legend, we only want to see Earth, Wind, and Fire. Our actual list of series is much longer…4 “elements”, up to 8 locations, making 32 legend entries, with 28 duplicates.

What’s the replacement for removeFromLegend? How do I prevent these duplications?

Version
transitioning to v3 now, v4 soon.
  • You must to post comments
2
1

Hi, there.

SCILegendModifier has property called sourceMode.
What you can do is to set ‘sourceMode’ to .selectedSeries and then select your renderableSeries, like this:

let legendModifier = SCILegendModifier()
legendModifier.sourceMode = .selectedSeries

let line4 = SCIFastLineRenderableSeries()
line4.isSelected = true

Another option is to create your custom legend, which is a collectionView under the hood, with custom dataSource. Here you can find a link to the documentation

Hope, that helped.

  • 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