mirror of
https://github.com/grafana/grafana.git
synced 2024-12-02 05:29:42 -06:00
Logs Panel: Add total count to logs volume panel in explore (#80730)
add vizLegend override so logs volume can display sum
This commit is contained in:
parent
f347de967c
commit
c7859c2fa9
@ -25,6 +25,7 @@ import {
|
|||||||
SortOrder,
|
SortOrder,
|
||||||
GraphThresholdsStyleConfig,
|
GraphThresholdsStyleConfig,
|
||||||
TimeZone,
|
TimeZone,
|
||||||
|
VizLegendOptions,
|
||||||
} from '@grafana/schema';
|
} from '@grafana/schema';
|
||||||
import { PanelContext, PanelContextProvider, SeriesVisibilityChangeMode, useTheme2 } from '@grafana/ui';
|
import { PanelContext, PanelContextProvider, SeriesVisibilityChangeMode, useTheme2 } from '@grafana/ui';
|
||||||
import { GraphFieldConfig } from 'app/plugins/panel/graph/types';
|
import { GraphFieldConfig } from 'app/plugins/panel/graph/types';
|
||||||
@ -56,6 +57,7 @@ interface Props {
|
|||||||
thresholdsConfig?: ThresholdsConfig;
|
thresholdsConfig?: ThresholdsConfig;
|
||||||
thresholdsStyle?: GraphThresholdsStyleConfig;
|
thresholdsStyle?: GraphThresholdsStyleConfig;
|
||||||
eventBus: EventBus;
|
eventBus: EventBus;
|
||||||
|
vizLegendOverrides?: Partial<VizLegendOptions>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function ExploreGraph({
|
export function ExploreGraph({
|
||||||
@ -76,6 +78,7 @@ export function ExploreGraph({
|
|||||||
thresholdsConfig,
|
thresholdsConfig,
|
||||||
thresholdsStyle,
|
thresholdsStyle,
|
||||||
eventBus,
|
eventBus,
|
||||||
|
vizLegendOverrides,
|
||||||
}: Props) {
|
}: Props) {
|
||||||
const theme = useTheme2();
|
const theme = useTheme2();
|
||||||
const previousTimeRange = usePrevious(absoluteRange);
|
const previousTimeRange = usePrevious(absoluteRange);
|
||||||
@ -180,9 +183,10 @@ export function ExploreGraph({
|
|||||||
showLegend: true,
|
showLegend: true,
|
||||||
placement: 'bottom',
|
placement: 'bottom',
|
||||||
calcs: [],
|
calcs: [],
|
||||||
|
...vizLegendOverrides,
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
[tooltipDisplayMode]
|
[tooltipDisplayMode, vizLegendOverrides]
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -68,6 +68,9 @@ export function LogsVolumePanel(props: Props) {
|
|||||||
return (
|
return (
|
||||||
<div style={{ height }} className={styles.contentContainer}>
|
<div style={{ height }} className={styles.contentContainer}>
|
||||||
<ExploreGraph
|
<ExploreGraph
|
||||||
|
vizLegendOverrides={{
|
||||||
|
calcs: ['sum'],
|
||||||
|
}}
|
||||||
graphStyle="lines"
|
graphStyle="lines"
|
||||||
loadingState={logsVolumeData.state ?? LoadingState.Done}
|
loadingState={logsVolumeData.state ?? LoadingState.Done}
|
||||||
data={logsVolumeData.data}
|
data={logsVolumeData.data}
|
||||||
|
Loading…
Reference in New Issue
Block a user