How can i remove left and bottom Bar in Chart.js

0👍

You can use drawBorder: false option of the axis grid. Check the following example.

var myChart = new Chart(ctx, {
  type: "bar",
  data: {
    labels: ["Réelle", "Attendue"],
    datasets: [
      {
        borderColor: ["rgb(255, 99, 132)", "rgb(54, 162, 235)"],
        backgroundColor: ["rgba(255, 99, 132, .2)", "rgba(54, 162, 235, .2)"],
        fill: true,
        data: [12, 19]
      }
    ]
  },
  options: {
    plugins: {
      legend: {
        display: false
      }
    },
    scales: {
      x: {
        grid: {
          display: false,
          drawBorder: false
        }
      },
      y: {
        ticks: {
          display: false
        },
        grid: {
          display: false,
          drawBorder: false
        }
      }
    }
  }
});

Leave a comment