[Chartjs]-How to move axis labels to the outer border when using center position

1👍

I wasn’t able to find a solution so I resorted to faking it by doing this:

  • Create another set of x and y axes
  • Hide their ticks marks and disable the grid display
  • Move the titles from the original axes to the new ones
  • Set their position to the left/bottom respectively
x1: {
          title: {
            display: true,
            text: 'X Title',
            padding: 20
          },
          display: true,
          position: 'bottom',
          grid: {
            drawOnChartArea: false, 
          },
          ticks: {
            display: false,
          },
        },
    }

Leave a comment