Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
110
Tooltips for the labels in the legend
posted

Hi,

 We wanted to show tooltips on the labels which are in the legend of an UltraChart. Is there any way out to do this.

 

Thanks in advance

  • 17605
    Verified Answer
    posted

    Here is some code you can try using to achieve your functionality. Unfortunately, you are constrained to using <ITEM_LABEL> for all tooltips in this example. If you want to request this as an official feature then please visit this page: http://devcenter.infragistics.com/protected/requestfeature.asp

    this.ultraChart1.Tooltips.FormatString = "<ITEM_LABEL>";

    this.ultraChart1.ChartDrawItem += new Infragistics.UltraChart.Shared.Events.ChartDrawItemEventHandler(ultraChart1_ChartDrawItem);

    ...void ultraChart1_ChartDrawItem(object sender, Infragistics.UltraChart.Shared.Events.ChartDrawItemEventArgs e)

    {

    Box box = e.Primitive as Box;

    if (box == null)

    {

    return;

    }

    if (string.IsNullOrEmpty(box.Path))

    {

    return;

    }

    if (box.Path.EndsWith("Legend") == false)

    {

    return;

    }

    // this is the external legend box

    if (box.Column == -1)

    {

    return;

    }

    // this is the code for showing tooltips

    box.Caps = PCaps.HitTest | PCaps.Tooltip;

    }