fix: Bars of a custom monitoring dashboard exceed the boundary
Created by: weili520
Signed-off-by: TheYoungManLi cjl@kubesphere.io
What type of PR is this?
/kind bug
What this PR does / why we need it:
This problem is caused by the bar interval being bigger than the data interval, the response data just has one and its position is at the first of the response data, so the bar will be out of the boundary.
So, if the response data is just one and it is at the start or tail of xAxis, we will add padding for xAxis and adjust the width of the bar to avoid this problem.
Which issue(s) this PR fixes:
Fixes ##3118 (closed)
Special notes for reviewers:
Does this PR introduced a user-facing change?
Bars of a custom monitoring dashboard exceed the boundary