mirror of
https://github.com/grafana/grafana.git
synced 2024-11-28 03:34:15 -06:00
Barchart: Fix tooltip erroneous header (#60741)
This commit is contained in:
parent
7a679db08b
commit
283cdc184e
@ -24,5 +24,5 @@ export const DataHoverRow = ({ feature }: Props) => {
|
||||
data = new ArrayDataFrame([properties]);
|
||||
}
|
||||
|
||||
return <DataHoverView data={data} rowIndex={rowIndex} displayExemplarHeader={false} />;
|
||||
return <DataHoverView data={data} rowIndex={rowIndex} />;
|
||||
};
|
||||
|
@ -19,17 +19,10 @@ export interface Props {
|
||||
columnIndex?: number | null; // the hover column
|
||||
sortOrder?: SortOrder;
|
||||
mode?: TooltipDisplayMode | null;
|
||||
displayExemplarHeader?: boolean;
|
||||
header?: string;
|
||||
}
|
||||
|
||||
export const DataHoverView = ({
|
||||
data,
|
||||
rowIndex,
|
||||
columnIndex,
|
||||
sortOrder,
|
||||
mode,
|
||||
displayExemplarHeader = true,
|
||||
}: Props) => {
|
||||
export const DataHoverView = ({ data, rowIndex, columnIndex, sortOrder, mode, header = undefined }: Props) => {
|
||||
const styles = useStyles2(getStyles);
|
||||
|
||||
if (!data || rowIndex == null) {
|
||||
@ -70,9 +63,9 @@ export const DataHoverView = ({
|
||||
|
||||
return (
|
||||
<div className={styles.wrapper}>
|
||||
{displayExemplarHeader && (
|
||||
{header && (
|
||||
<div className={styles.header}>
|
||||
<span className={styles.title}>Exemplar</span>
|
||||
<span className={styles.title}>{header}</span>
|
||||
</div>
|
||||
)}
|
||||
<table className={styles.infoWrap}>
|
||||
|
@ -28,7 +28,7 @@ type Props = {
|
||||
|
||||
export const HeatmapHoverView = (props: Props) => {
|
||||
if (props.hover.seriesIdx === 2) {
|
||||
return <DataHoverView data={props.data.exemplars} rowIndex={props.hover.dataIdx} />;
|
||||
return <DataHoverView data={props.data.exemplars} rowIndex={props.hover.dataIdx} header={'Exemplar'} />;
|
||||
}
|
||||
return <HeatmapHoverCell {...props} />;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user