chartjs / chartjs-plugin-datalabels

Chart.js plugin to display labels on data elements
https://chartjs-plugin-datalabels.netlify.app
MIT License
863 stars 460 forks source link

clamp does not work properly for bar chart with align==='end' and anchor==='end' #345

Open tearfur opened 1 year ago

tearfur commented 1 year ago

chart.js@3.9.1 chartjs-plugin-datalabels@2.1.0

config = {
  type: 'bar',
  /* ... */
  options: {
    /* ... */
    datalabels: {
      clamp: true,
      anchor: 'end',
      align: 'end'
    }
  }
}

If the bar is as long as the y-axis, then the data label won't show.