English 中文(简体)
Chart.js V4.3.0 X-Axis Labels Not Aligning
原标题:
  • 时间:2023-06-05 02:55:57
  •  标签:
  • chart.js

Using Chart.js v4.3.0, I m trying to left-align x-axis labels on a vertical bar chart. They are centered by default and my reading of the docs indicates that adding this to the chart s options would do it:

ticks: {
  align:  start ,
},

Weirdly, that moves the labels slightly right and still not aligned.

CodePen demo of issue: https://codepen.io/ChrisBup/pen/qBQWqPw

Expected Behavior:

Screenshot 2023-06-04 at 10 42 25 PM

I set labelOffset to get the screenshot, but as it only takes a number of pixels, it s not a responsive solution.

Extra Context:

Chart.js version: 4.3.0

Browser: Chrome Version 113.0.5672.126 (Official Build) (arm64)

问题回答

暂无回答




相关问题
Multiple line on x-axis in a linear chart did not show

I have a single axis line chart. The user would choose the year from a dropdown and the loan_type from another dropdown. The chart then should load the 12-months record of annual_payment and ...

Chart.js V4.3.0 X-Axis Labels Not Aligning

Using Chart.js v4.3.0, I m trying to left-align x-axis labels on a vertical bar chart. They are centered by default and my reading of the docs indicates that adding this to the chart s options would ...

How align bottom legend vertically Chart.js

How align bottom legend vertically Chart.js ? enter image description here https://www.chartjs.org/docs/latest/samples/other-charts/doughnut.html I need to align this code according to the image I ...

热门标签