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

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.