[Chartjs]-ChartJS, Primeng, Gap first and end of line chart

1๐Ÿ‘

โœ…

I finally found the problem,
for other people facing this issue, you can add unit to your axis:

                xAxes: [{
                    type: 'time',
                    time: {
                        displayFormats: {
                            minute: 'h:mm',     // formatting data in labels
                        },
                        unit: 'minute'          // destroy first and end gaps
                    },
                    display: false,             // preventing labels from being displayed
                }],

similar issue on github:
https://github.com/chartjs/Chart.js/issues/2277#issuecomment-314662961

Leave a comment