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
395
Can I change ultrachart tooltips text alignment ?
posted

Hi,

I'm using Infragistics 8.1 ultrawinchart.

In my chart I set a multilined text (simply a text containing \n ) to a tooltip label , and it's rendered with center-aligned text. Is it possible to change the text alignment ?

 

Thx in advance

 

PS

sorry for my bad english

Parents Reply
  • 395
    posted in reply to Marco

    Given that in infragistics 9.2 there's a bug that occurrs by setting tooltips Format to None (for an ultrachart docked under a ribbon, as shown  here ), I can't use a custom tooltipmanager to change tooltip text alignment anymore .

    Thus, I want to report a way I have found (actually very tricky), to change ultrachart tooltip text alignment.

    Here's the code (you have to handle mouseMove ultraChart event)

     

      private void ultraChart_MouseMove(object sender, MouseEventArgs e)
    {
        var innerTooltip = this.ultraChart.Tooltips.TooltipControl as Infragistics.Win.UltraWinChart.IGWinTooltip;
        if (innerTooltip != null)
        {
            if (innerTooltip.Scene != null)
            {
                foreach (var primitive in innerTooltip.Scene)
                {
                    var txt = primitive as Infragistics.UltraChart.Core.Primitives.Text;
                    if (txt != null)
                    {
                        txt.labelStyle.HorizontalAlign = StringAlignment.Near;
                    }
                }
            }
        }
    }

    I think it's very tricky because if you hide TooltipControl property to intellisense, probably the use of it can be dangerous...

    So please, tell me whether it is a reasonable way or not.

     

    Thanks in advance.

    Marco

Children
No Data