kurkle / chartjs-plugin-autocolors

Automatic color generation for Chart.js
MIT License
56 stars 8 forks source link

Black color when there is no data when graph is first loaded #32

Open unluckychild opened 6 months ago

unluckychild commented 6 months ago

I update graph via ajax, but when the page/graph is first loaded and without data, it shows nothing. Its OK, but when i update graph with new set of data, there is only black color for all graphs.

AlexanderZhirov commented 5 months ago

Confirm. Does not work when update from an empty dataset. I have a black schedule.

type: 'pie',
        labels: [],
        data: {
            datasets: [{
                data: [],
                label: 'Voices: ',
                borderWidth: 2
            }]
        },
        options: {
            plugins: {
                autocolors: {
                    enabled: true,
                    mode: 'data'
                }
            }
        }

изображение

marcossegovia commented 1 month ago

Hi team, I am facing the same issue. Is there any fix/workaround for the above issue?

unluckychild commented 1 month ago

Yeah, i fixed this by not using this plugin. I now use only default chartjs colors, this fixed the problem