jQuery UI Widgets Forums Chart Having Trouble with toolTipFormatFunction

This topic contains 1 reply, has 1 voice, and was last updated by  snowfi6916 12 years, 8 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author

  • snowfi6916
    Member

    I want to take a very large number that looks like this:

    123456789

    And make it so it looks like this in the tooltip when I click in my line graph:

    $123,456,789

    I have this function to add the commas:

    function addCommas(str)
    {
    var amount = new String(str);
    amount = amount.split(“”).reverse();

    var output = “”;
    for (var i = 0; i <= amount.length – 1; i++)
    {
    output = amount[i] + output;
    if ((i + 1) % 3 == 0 && (amount.length – 1) !== i)
    output = ',' + output;
    }
    return output;
    }

    My tooltipFormatFunction looks like this:

    toolTipFormatFunction : function(value)
    {
    var newValue = addCommas(value);
    return "$" + newValue;
    }

    Nothing changes in my tooltip. Please help? Thanks.


    snowfi6916
    Member

    Never mind. I had the toolTipFormatFunction under “valueAxis” instead of “Series”. It works now.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.