mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
BarChart: fix top y tick clipping when x labels are rotated (#52964)
This commit is contained in:
parent
11c79cd6da
commit
7c40257baf
@ -1,5 +1,5 @@
|
||||
import { orderBy } from 'lodash';
|
||||
import { Padding } from 'uplot';
|
||||
import uPlot, { Padding } from 'uplot';
|
||||
|
||||
import {
|
||||
ArrayVector,
|
||||
@ -302,7 +302,7 @@ function getRotationPadding(frame: DataFrame, rotateLabel: number, valueMaxLengt
|
||||
// Add padding to the bottom to avoid clipping the rotated labels.
|
||||
const paddingBottom = Math.sin(((rotateLabel >= 0 ? rotateLabel : rotateLabel * -1) * Math.PI) / 180) * maxLength;
|
||||
|
||||
return [0, paddingRight, paddingBottom, paddingLeft];
|
||||
return [Math.round(UPLOT_AXIS_FONT_SIZE * uPlot.pxRatio), paddingRight, paddingBottom, paddingLeft];
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
|
Loading…
Reference in New Issue
Block a user