Graph: Legend decimals now work as expected (#24931)
* Graph: Legend decimals now work as expected * removed new test that I could not get green
This commit is contained in:
Родитель
6099398c37
Коммит
8aedf81133
|
@ -25,6 +25,7 @@ const formatTests: ValueFormatTest[] = [
|
|||
{ id: 'ms', decimals: 0, value: 1200, result: '1 s' },
|
||||
{ id: 'short', decimals: 0, scaledDecimals: -1, value: 98765, result: '98.77 K' },
|
||||
{ id: 'short', decimals: 0, scaledDecimals: 0, value: 9876543, result: '9.876543 Mil' },
|
||||
{ id: 'short', decimals: 2, scaledDecimals: null, value: 9876543, result: '9.88 Mil' },
|
||||
{ id: 'kbytes', decimals: 3, value: 10000000, result: '9.537 GiB' },
|
||||
{ id: 'deckbytes', decimals: 3, value: 10000000, result: '10.000 GB' },
|
||||
{ id: 'megwatt', decimals: 3, value: 1000, result: '1.000 GW' },
|
||||
|
|
|
@ -98,8 +98,8 @@ export default class TimeSeries {
|
|||
hideTooltip: boolean;
|
||||
allIsNull: boolean;
|
||||
allIsZero: boolean;
|
||||
decimals: number;
|
||||
scaledDecimals: number;
|
||||
decimals: DecimalCount;
|
||||
scaledDecimals: DecimalCount;
|
||||
hasMsResolution: boolean;
|
||||
isOutsideRange: boolean;
|
||||
|
||||
|
@ -344,8 +344,8 @@ export default class TimeSeries {
|
|||
|
||||
updateLegendValues(formater: ValueFormatter, decimals: DecimalCount, scaledDecimals: DecimalCount) {
|
||||
this.valueFormater = formater;
|
||||
this.decimals = decimals ?? 0;
|
||||
this.scaledDecimals = scaledDecimals ?? 0;
|
||||
this.decimals = decimals;
|
||||
this.scaledDecimals = scaledDecimals;
|
||||
}
|
||||
|
||||
formatValue(value: number) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче