Home forums Using CanvasJS Format date in tooltip content

Tagged: 

This topic contains 3 replies, has 2 voices, and was last updated by  Anjali 1 year, 9 months ago.

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

    Widgy
    Participant

    I have my X axis as a date with time and would like to show the date and time in the tooltip content when a user hovers over my line graph. I see you can customize the tooltip content using this option http://canvasjs.com/docs/charts/chart-options/data/tooltipcontent/ , but I do not see how I can format the date display the time with it as well.

    #8266

    Anjali
    Participant

    widgy,

    Please use xValueFormatString property of dataSeries.

    __
    Anjali

    #8273

    Widgy
    Participant

    Thanks, that is what I was looking for. When I first looked at the docs for that property, I thought that would have changed the label as well since it says “Defines how x axis values must be formatted before they appear on the indexLabel or toolTip,” but looking at the sample on the page it doesn’t change the indexLabel. Is that right?

    #8289

    Anjali
    Participant

    widgy,

    Format string for labels on axisX are defined by valueFormatString property of axisX and xValueFormatString controls formatting of x values outside the axis.

    I thought that would have changed the label as well since it says “Defines how x axis values must be formatted before they appear on the indexLabel or toolTip.

    That was a typo and we have fixed the same. Thanks for reporting.

    __
    Anjali

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

You must be logged in to reply to this topic.