mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
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:
parent
0c38a3ba97
commit
e0c630e915
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user