Home Forums Report Bugs Bug on chartContainer

Bug on chartContainer

Viewing 2 posts - 1 through 2 (of 2 total)
  • #26313

    Dear,
    Chart on this date is mistake, please help to check,

    var chart = new CanvasJS.Chart(“chartContainer”, {
    animationEnabled: true,
    exportEnabled: true,
    title: {
    text: “Summary of FullBranch”
    },
    axisX: {
    minimum: new Date(2019,01,28),
    maximum: new Date(2019,02,05),
    valueFormatString: “mmdd”
    },
    axisY: {
    title: “”,
    titleFontColor: “#4F81BC”,
    suffix: “”
    },
    data: [{
    indexLabelFontColor: “#5A5757”,
    indexLabel: “{y}”,
    name: “views”,
    type: “area”,
    yValueFormatString: “#”,
    dataPoints: [
    { x: new Date(2019,01,28), y: 10, label: “01-28”, indexLabel: “”, },
    { x: new Date(2019,01,29), y: 20, label: “01-29”, indexLabel: “”, },
    { x: new Date(2019,01,30), y: 30, label: “01-30”, indexLabel: “”, },
    { x: new Date(2019,01,31), y: 40, label: “01-31”, indexLabel: “”, },
    { x: new Date(2019,02,01), y: 50, label: “02-01”, indexLabel: “”, },
    { x: new Date(2019,02,02), y: 60, label: “02-02”, indexLabel: “”, },
    { x: new Date(2019,02,03), y: 70, label: “02-03”, indexLabel: “”, },
    { x: new Date(2019,02,04), y: 80, label: “02-04”, indexLabel: “”, },
    { x: new Date(2019,02,05), y: 90, label: “02-05”, indexLabel: “”, },
    ]
    }]
    });
    chart.render();

    #26322

    @daicc,

    In JavaScript Month starts from 0 (January) and ends at 11(December). So in your case both Date(2019,01,29) and Date(2019,02,01) represents 1st of March hence chart displays two dataPoints on “02-01”. Please take a look at this JSFiddle for working example.

    —-
    Manoj Mohan
    Team CanvasJS

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

You must be logged in to reply to this topic.