mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
BarGauge: Round sizing to avoid float widths
LED cell width needs to be integers
This commit is contained in:
@@ -136,8 +136,9 @@ export class BarGauge extends PureComponent<Props> {
|
|||||||
const valueRange = maxValue - minValue;
|
const valueRange = maxValue - minValue;
|
||||||
const maxSize = isVert ? maxBarHeight : maxBarWidth;
|
const maxSize = isVert ? maxBarHeight : maxBarWidth;
|
||||||
const cellSpacing = itemSpacing!;
|
const cellSpacing = itemSpacing!;
|
||||||
const cellCount = maxSize / 20;
|
const cellWidth = 12;
|
||||||
const cellSize = (maxSize - cellSpacing * cellCount) / cellCount;
|
const cellCount = Math.floor(maxSize / cellWidth);
|
||||||
|
const cellSize = Math.floor((maxSize - cellSpacing * cellCount) / cellCount);
|
||||||
const valueColor = getValueColor(this.props);
|
const valueColor = getValueColor(this.props);
|
||||||
const valueStyles = getValueStyles(value.text, valueColor, valueWidth, valueHeight);
|
const valueStyles = getValueStyles(value.text, valueColor, valueWidth, valueHeight);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user