zig.com Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<script src="../../cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.4/Chart.js"></script>
<body>
<canvas id="myChart" style="width:100%;max-width:600px"></canvas>
<script>
  const xValues = ["Italy", "France", "Spain", "USA", "Argentina"];
  const yValues = [55, 49, 44, 24, 15];
  const barColors = ["red", "green", "blue", "orange", "brown"];
  new Chart("myChart", {
    type: "bar",
    data: {
      labels: xValues,
      datasets: [{
        backgroundColor: barColors,
        data: yValues
      }]
    },
    options: {
      legend: { display: false },
      title: {
        display: true,
        text: "World Wine Production 2018"
      }
    }
  });
</script>
</body>
<!-- /js/tryit.asp?filename=trychartjs_bars_colors_more  Thu, 06 Feb 2025 19:15:42 GMT -->
</html>