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

0
0

Hello, I have tried to see if it is possible to show the rollover without showing any labels so that is is just a vertical bar. I was searching on StackOverflow and a few answers said it was not possible to omit any of the values from the graph. I did see that we can customize the cursor, is it possible to just have it be a vertical bar instead of a cross?? Then I could just use it instead of the default rollover.

I am linking a mockup we made of what we want to make. In the image, you have the graphic showing where the use as pressed, and above the graphic, we will show and update a graphic with the relevant information for that point.

Also, I will need to programmatically dismiss it so it will need to stay visible even if the user is panning or zooming.

Version
v3
Images
  • You must to post comments
0
0

Hi, Pascale.
Let’s answer your questions one by one.

To hide everything except vertical line you need to do the following:
a) Create CustomSeriesInfoProvider as a subclass of SCIDefaultXySeriesInfoProvider and set it to renderableSeries.seriesInfoProvider
b) Create CustomXySeriesTooltip as a subclass of SCIXySeriesTooltip, override internalUpdate(with seriesInfo: SCIXySeriesInfo!) and do nothing here
c) Return your CustomXySeriesTooltip in CustomSeriesInfoProvider

private class CustomSeriesInfoProvider: SCIDefaultXySeriesInfoProvider {
  class CustomXySeriesTooltip: SCIXySeriesTooltip {
      override func internalUpdate(with seriesInfo: SCIXySeriesInfo!) {
      }
  }

  override func getSeriesTooltipInternal(seriesInfo: SCIXySeriesInfo!, modifierType: AnyClass!) -> ISCISeriesTooltip! {
      if (modifierType == SCIRolloverModifier.self) {
          return CustomXySeriesTooltip(seriesInfo: seriesInfo)
      } else {
          return super.getSeriesTooltipInternal(seriesInfo: seriesInfo, modifierType: modifierType)
      }
  }
}

You can get the current index from CustomXySeriesTooltip internalUpdate function like this:

override func internalUpdate(with seriesInfo: SCIXySeriesInfo!) {
    print(seriesInfo.formattedXValue, seriesInfo.formattedYValue)
}

More about creating custom gesture modifiers here: https://www.scichart.com/documentation/ios/current/custom-modifiers—the-scigesturemodifierbase-api.html
More about tooltips customization you can find here: https://www.scichart.com/documentation/ios/current/interactivity—tooltips-customization.html

Let us know if it helped.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.