Home forums Chart Support Format “onmouseover” Text

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #29734

    Hi all!

    I just can’t figure out how to format the values.
    I’d prefer time instead of date or both and I’d like to round the temperature values.
    13,8 would be accurate enough ;)

    Thx for help!



    You can format the x and y-values being shown in toolTip by setting the xValueFormatString and yValueFormatString respectively, as per your requirement.

    If you are still facing the issue, kindly create a JSFiddle reproducing the issue you are facing and share it with us so that we can look into the code, understand the scenario better and help you out.

    Shashi Ranjan
    Team CanvasJS


    I’m not sure if it is the “best practice” but I was able to solve my problem via
    contentFormatter: function ( e ) {
    var content = \” \”;
    for (var i = 0; i < e.entries.length; i++) {
    content += e.entries[i].dataSeries.name + \”<br/>Datum: \” +(new
    Date(e.entries[i].dataPoint.x)).toLocaleString(\”de-DE\”) + \”<br/>Wert: \”
    content += \”<br/>\”;
    return content;

    Additiional chars due to embedded into PHP



    xValueFormatString and yValueFormatString properties can be used to format the respective x and y-values being shown in toolTip & indexLabel. However, to customize the complete content as per your requirement you can use toolTip contentFormatter function.

    Shashi Ranjan
    Team CanvasJS

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

You must be logged in to reply to this topic.