Pre loader

Custom Rollover Cursor Label Text



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


Is there an alternative approach to accomplish this within SciChart?

Thank you.

  • You must to post comments
Best Answer

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,

  • 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