GraphNG: display original values in the tooltip when stacking (#33740)

This commit is contained in:
Dominik Prokop 2021-05-05 13:28:35 +02:00 committed by GitHub
parent dbcfebac56
commit b2d4730ca1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -95,7 +95,7 @@ export const TooltipPlugin: React.FC<TooltipPluginProps> = ({
const plotSeries = plotInstance.series;
const fieldFmt = field.display || getDisplayProcessor({ field, timeZone, theme });
const value = fieldFmt(plotInstance.data[focusedSeriesIdx!][focusedPointIdx]);
const value = fieldFmt(field.values.get(focusedPointIdx));
tooltip = (
<SeriesTable
@ -128,7 +128,7 @@ export const TooltipPlugin: React.FC<TooltipPluginProps> = ({
continue;
}
const value = field.display!(plotInstance.data[i][focusedPointIdx]);
const value = field.display!(otherProps.data.fields[i].values.get(focusedPointIdx));
series.push({
// TODO: align with uPlot typings