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.
- C Bolton asked 4 years ago
- You must login to post comments
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
- Yura Khariton answered 4 years ago
- You must login to post comments
Please login first to submit.