Home Forums Chart Support Date scaling Axis

Date scaling Axis

Viewing 3 posts - 1 through 3 (of 3 total)
  • #30275

    Hi,

    in my stacked column chart i need a cleaner formating / scaling. The bars should only have a with by 1 day / date or with other words, on axis a date should only appear once.

    <img src="<img src=”https://i.ibb.co/y8j9rMj/Unbenannt.png&#8221; alt=”Unbenannt” border=”0″ />” alt=”Image” />

    axisX:{
    labelFontFamily: font,
    margin: 10,
    labelFormatter: function (e) {
    return CanvasJS.formatDate( e.value, “DD MMM YYYY”);
    },
    },

    dataPoints: Array(2)
    0:
    x: Wed Apr 29 2020 02:00:00 GMT+0200 (Mitteleuropäische Sommerzeit)
    y: 1
    1:
    x: Fri May 01 2020 02:00:00 GMT+0200 (Mitteleuropäische Sommerzeit)
    y: 1

    And how can i show the Date in Tooltip of the bar?

    • This topic was modified 4 years, 5 months ago by mwick. Reason: Image broken
    #30292

    @mwick,

    You can set the axisX intervalType as ‘day’ and interval as 1 to achieve your requirement. For formatting the date and time values in toolTip you can set xValueFormatString as per your scenario.

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


    Shashi Ranjan
    Team CanvasJS

    #30296

    Thank you!

    • This reply was modified 4 years, 5 months ago by mwick.
Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.