Pre loader

Custom Rollover Cursor Label Text

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

Answered
0
0

Hello,

I’m trying to add custom text to a rollover cursor that is dependent on its X and Y Values.

For instance, if the Y Value is 1, but the X value (date) is old, it should say “1 ft Observed”, but if it the date is in the future, it should say “1 ft Predicted”. I can format the cursor label via NumericLabelProvider, but it only provides me the Y value, and I need the corresponding X value as well to properly format the cursor label.

    class NumericLabelProviderEx() : NumericLabelProvider() {
        override fun formatCursorLabel(doubleValue: Double): CharSequence {
            val formatString = "%.1f %s\n%s"
            // Any way to get corresponding X value for this so I can change "Observed" to "Predicted" if this point is in the future?
            val s = String.format(formatString, doubleValue, "ft", "Observed")
            return s
        }
    }

    yAxis.setLabelProvider(NumericLabelProviderEx())

Is there an alternative approach to accomplish this within SciChart?

Thank you.

Version
3.1.0.4322
  • You must to post comments
Best Answer
0
0

Hi there,

We have an example which shows how to customize RolloverModifier tooltips. If you use same approach you’ll get SeriesInfo associated with tooltip which contains X and Y values that you can use for formatting.

Best regards,
Yura

  • 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