Skip to content

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:

截屏2022-04-20 13 58 01

截屏2022-04-20 14 05 10

Does this PR introduced a user-facing change?

Bars of a custom monitoring dashboard exceed the boundary

Additional documentation, usage docs, etc.:

合并请求报告

加载中