79116220

Date: 2024-10-23 02:04:48
Score: 1
Natty:
Report link

You can adjust the number of ticks you need by using stepSize and maxTicksLimit.

For reference, please check the definition here:
https://www.chartjs.org/docs/latest/api/#radialtickoptions

options: {
  legend: { display: false },
  responsive: false,
  maintainAspectRatio: false,
  scales: {
    x: {
      type: "time",
      distribution: "timeseries",
      time: { 
        parser: "YYYY-MM-DDTHH:mm", 
        tooltipFormat: "ll" 
      },
      ticks: {
        source: "data",
        maxRotation: 90,
        minRotation: 90,
        autoSkip: false
      }
    },
    y: { 
      ticks: { 
        beginAtZero: true, 
        major: { enabled: true }, 
        autoSkip: false,
        stepSize: 5,  // Set the interval for Y-axis ticks
        maxTicksLimit: 100,  // Set the maximum number of ticks displayed
        suggestedMax: 100,  // Suggest the maximum value for Y-axis
        suggestedMin: 0  // Suggest the minimum value for Y-axis
      } 
    }
  },
  tooltips: {
    callbacks: {
      label: this.label || defaultLabel
    }
  },
}
Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Poku Ku