Skip to content

Commit 7ba0c81

Browse files
committed
Add axis grace and integer tick labels
1 parent 407e31c commit 7ba0c81

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/components/ChartContainer.jsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,13 +314,20 @@ export default function ChartContainer({
314314
title: { display: true, text: 'Step' },
315315
min: xRange.min,
316316
max: xRange.max,
317-
bounds: 'data'
317+
bounds: 'data',
318+
grace: '2%',
319+
ticks: {
320+
callback: function (value) {
321+
return Math.round(value);
322+
}
323+
}
318324
},
319325
y: {
320326
type: 'linear',
321327
display: true,
322328
title: { display: true, text: 'Value' },
323329
bounds: 'data',
330+
grace: '5%',
324331
ticks: {
325332
callback: function (value) {
326333
return Number(value.toPrecision(2));

0 commit comments

Comments
 (0)