React-chartjs-2: Stacked Bar Chart with time scale weird visualisation error

Created on 11 Apr 2018  路  3Comments  路  Source: reactchartjs/react-chartjs-2

What it looks like (false behavior)

screen shot 2018-04-11 at 16 10 25

My Options

options = {
    {
        legend: {
            display: false
        },
        maintainAspectRatio: false,
        scales: {
            xAxes: [{
                stacked: true,
                title: 'time',
                type: 'time',
                gridLines: {
                    lineWidth: 2
                },
                time: {
                    unit: 'day',
                    unitStepSize: 1
                },
                ticks: {
                    maxRotation: 0
                }
            }],
            yAxes: [{
                stacked: true,
                ticks: {
                    beginAtZero: true
                }
            }]
        }
    }
}

My datasets

datasets: [{
        label: 'one',
        data: [{
                x: '2016-12-25',
                y: 20
            },
            {
                x: '2016-12-26',
                y: 10
            }
        ],
        backgroundColor: 'green'
    },
    {
        label: 'two',
        data: [{
                x: '2016-12-27',
                y: 20
            },
            {
                x: '2016-12-28',
                y: 10
            }
        ],
        backgroundColor: 'red'
    }
]
}

All 3 comments

your dates are different. have two values on the same date and it should work

But why can't it display the chart if I have two different dates wtf

Obviously that's the way stacked graph works. I will give you an opportunity to review your comment and remove profanity before i report you to the moderators. We all are developers here and I am just another developer who happens to use RC 2.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

n1c01a5 picture n1c01a5  路  4Comments

pkellner picture pkellner  路  4Comments

alexchoiweb picture alexchoiweb  路  3Comments

souuu picture souuu  路  4Comments

flyingpath picture flyingpath  路  5Comments