mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Statetimeline/TimeSeries/BarChart: Limit y label width to 40% of visualiation width (#42350)
This commit is contained in:
parent
802ffa3f03
commit
820aa3ac59
@ -75,7 +75,10 @@ export class UPlotAxisBuilder extends PlotConfigBuilder<AxisProps, Axis> {
|
||||
(acc, value) => Math.max(acc, measureText(value, UPLOT_AXIS_FONT_SIZE).width),
|
||||
0
|
||||
);
|
||||
axisSize += axis!.gap! + axis!.labelGap! + maxTextWidth;
|
||||
// limit y tick label width to 40% of visualization
|
||||
const textWidthWithLimit = Math.min(self.width * 0.4, maxTextWidth);
|
||||
// Not sure why this += and not normal assignment
|
||||
axisSize += axis!.gap! + axis!.labelGap! + textWidthWithLimit;
|
||||
}
|
||||
|
||||
return Math.ceil(axisSize);
|
||||
|
Loading…
Reference in New Issue
Block a user