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

0
0

I’ve enabled the Rollover on my chart, and I am trying to make a custom AxisLabelTemplate, which is easy to do if you are just looking to add some text/format around the AxisFormattedDataValue.

However, what i really want to do is to use the AxisInfo.DataValue to look up a specific string related to each of the Avis values, and set this as my label text;

ie, if my axis DataValues are “1, 2, 3, 4, 5″I want the rollover text to read “1 – Dog”, “2 – Cat”, “3 – Fish”, “4 – Mouse”, “5 – Aardvark”

Is this possible?

Thanks

Version
5.1.0
  • You must to post comments
0
0

OK another interesting problem 🙂

RolloverModifier obeys the CursorTextFormatting property of the Axis. You can customize the text exactly using the LabelProvider feature, and overriding the following method

public class NumericLabelProvider : LabelProviderBase  
{
    public override string FormatCursorLabel(IComparable dataValue)
    {
         // TODO: Your label overriding
    }
}

This will affect all cursors you use on the chart, but if you have just RolloverModifier then sounds like it will do the trick!

Let me know if this helps,

Best regards,
Andrew

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.