function createChart()

in assets/ml.js [35:67]


function createChart(ctx, dataPoints, unit) {
  ctx = clearChart(ctx);

  charts[ctx.id] = new Chart(ctx, {
    type: "bar",
    data: {
      labels: dataPoints.map((point) => point.label),
      datasets: [
        {
          data: dataPoints.map((point) => point.value),
          backgroundColor: ctx.id.includes("ram")
            ? "rgba(255, 99, 132, 0.6)"
            : "rgba(54, 162, 235, 0.6)"
        }
      ]
    },
    options: {
      responsive: true,
      maintainAspectRatio: false,
      scales: { y: { beginAtZero: true } },
      plugins: {
        legend: { display: false },
        tooltip: {
          callbacks: {
            label: function(tooltipItem) {
              return tooltipItem.raw + " " + unit;
            }
          }
        }
      }
    }
  });
}