Status History Panel: Show X-Axis Value in Tooltip (#54563)

Co-authored-by: gitstart <gitstart@users.noreply.github.com>
Co-authored-by: gitstart <gitstart@gitstart.com>
Co-authored-by: Nitesh Singh <nitesh.singh@gitstart.dev>
Co-authored-by: Rubens Rafael <70234898+RubensRafael@users.noreply.github.com>
Co-authored-by: Rafael Toledo <87545086+Toledodev@users.noreply.github.com>
Co-authored-by: Matheus Benini Ferreira <88898100+MatheusBeniniF@users.noreply.github.com>
Co-authored-by: Matheus Benini <matheus_benini@hotmail.com>
Co-authored-by: Júlio Piubello da Silva Cabral <julio.piubello@gitstart.dev>
Co-authored-by: juliopiubello <juliopiubellow@gmail.com>
This commit is contained in:
GitStart 2022-09-21 03:57:47 +01:00 committed by GitHub
parent 0c38a3ba97
commit e0c630e915
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -49,6 +49,9 @@ export const StatusHistoryTooltip: React.FC<StatusHistoryTooltipProps> = ({
});
}
const xField = alignedData.fields[0];
const xFieldFmt = xField.display || getDisplayProcessor({ field: xField, timeZone, theme });
const dataFrameFieldIndex = field.state?.origin;
const fieldFmt = field.display || getDisplayProcessor({ field, timeZone, theme });
const value = field.values.get(datapointIdx!);
@ -64,9 +67,10 @@ export const StatusHistoryTooltip: React.FC<StatusHistoryTooltipProps> = ({
return (
<div>
<div style={{ fontSize: theme.typography.bodySmall.fontSize }}>
{fieldDisplayName}
<strong>{xFieldFmt(xField.values.get(datapointIdx)).text}</strong>
<br />
<SeriesTableRow label={display.text} color={display.color || FALLBACK_COLOR} isActive />
{fieldDisplayName}
</div>
{links.length > 0 && (
<div