Chart.js icon indicating copy to clipboard operation
Chart.js copied to clipboard

offset y axis by value

Open MartinCBBankdata opened this issue 2 years ago • 2 comments

Feature Proposal

My suggestion is that the offset becomes an number. Right now I try to change axis: Scale<CoreScaleOptions>, axis._startValue, axis._endValue, axis._valueRange but I am overwritten evertime something is drawed. Maybe there is way but it is very difficult. I need to offset the y-axis by a lot more than the standart true gives me.

y: {
offset: boolean
}
becomes 
y: {
offset: number
}

Possible Implementation

Change offset to take a value.

MartinCBBankdata avatar Nov 03 '22 15:11 MartinCBBankdata

Did you find any solution? I have the same problem but for the X axis.

YonatanHanan avatar Nov 13 '22 11:11 YonatanHanan

I found out that removing the x border line by drawboarder solve my problem. But if you want you can change the source code: https://github.com/chartjs/Chart.js/blob/master/src/scales/scale.linearbase.js#L297 this is line that controls the offset I think. It is half of the normal space between each tick on y axis.

MartinCBBankdata avatar Nov 14 '22 07:11 MartinCBBankdata