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
735
left align tooltips for a scatterchart
posted

In the tooltips text, I put serveral lines of text seperated by "\n". By default, the lines are center aligned. How to I left align these lines in the tooltips?

 

Thanks.

Zongwen

  • 28496
    Offline posted

    sorry, this isn't possible.  you can submit a feature request here: http://devcenter.infragistics.com/protected/requestfeature.aspx

    the closest thing i can offer is a function that pads out the lines of your string, so you can get this effect with a monospace font if you do something like this:

    theChart.Tooltips.FormatString = this.PadMultiLineString("hello hello hello\nworld!");

    private string PadMultiLineString(string input)

    {

    if (input == null)

    {

    return null;

    }

    string[ lines = input.Split('\n');

    int maxChars = 0;

    foreach (string line in lines)

    {

    maxChars =
    Math.Max(maxChars, line.Length);

    }

    for (int current = 0; current < lines.Length; current++)

    {

    lines[current] = lines[current].PadRight(maxChars);

    }

    return string.Join("\n", lines).Replace(" ", "\u00A0");

    }