carbon-charts
carbon-charts copied to clipboard
[Bug]: Too much space around bars in a bar chart with timescale if time range is large
Contact Details
No response
What happened?
The space left and right of the bars in a bar chart with timescale bottom axis is too much if time range is large:
^ use data testBug
in the sandbox
For lower time ranges it looks fine:
^ use data testWorking
in the sandbox
This bug was already reported in https://github.com/carbon-design-system/carbon-charts/issues/1343. However, I think their solution of adding the option timeScale: {addSpaceOnEdges: 0}
does not lead to a satisfactory result because then there is no space at all:
It would be better if there is always at least one empty tick between the bars and the edges like when using data testWorking
in the sandbox.
Version
0.57.0
Data & options used
See sandbox
Relevant log output
No response
Codesandbox example
https://codesandbox.io/s/pedantic-keldysh-llx57m?file=/src/index.js
I worked around this bug by specifying a custom domain which includes an extra time period left and right of the chart data time range and then using CSS to hide the first and last ticks on the bottom axis