Chartjs-Rendering issues when rendering a chartjs-chart-matrix

0👍

There is a wrong chart configuration.

The scales are defined inside the "plugins" node and that’s not correct.

Move the scales in the chart options:

  const options = {
    responsive: true,
    scales: {
      x: {
        type: "category",
        labels: ["apple", "banana", "coconut"],
        ticks: {
          display: true
        },
        grid: {
          display: false
        }
      },
      y: {
        type: "category",
        labels: ["fruit", "juice", "smoothie"],
        offset: true,
        ticks: {
          display: true
        },
        grid: {
          display: false
        }
      }
    },
  plugins: {
      title: {
        display: true,
        text: "fruits"
      },
    }
  };

Leave a comment