Skip to content

Commit 05e4bb3

Browse files
Fei ZFei
Fei Z
and
Fei
authored
fix: fix bar chart tooltip data (#692)
Co-authored-by: Fei <[email protected]>
1 parent 483be51 commit 05e4bb3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: packages/core/src/components/essentials/tooltip-bar.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -202,13 +202,15 @@ export class TooltipBar extends Tooltip {
202202
return `<div class="axis-tooltip"><p class="label">${data}</p></div>`;
203203
}
204204

205+
const rangeIdentifier = this.services.cartesianScales.getRangeIdentifier();
206+
205207
const formattedValue = Tools.getProperty(
206208
this.model.getOptions(),
207209
"tooltip",
208210
"valueFormatter"
209211
)
210212
? this.model.getOptions().tooltip.valueFormatter(data.value)
211-
: data.value.toLocaleString("en");
213+
: data[rangeIdentifier].toLocaleString("en");
212214

213215
return `<div class="datapoint-tooltip"><p class="value">${formattedValue}</p></div>`;
214216
}

0 commit comments

Comments
 (0)