Logs Panel: Add total count to logs volume panel in explore (#80730)

add vizLegend override so logs volume can display sum
pull/80608/head^2
Galen Kistler 1 year ago committed by GitHub
parent f347de967c
commit c7859c2fa9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 6
      public/app/features/explore/Graph/ExploreGraph.tsx
  2. 3
      public/app/features/explore/Logs/LogsVolumePanel.tsx

@ -25,6 +25,7 @@ import {
SortOrder,
GraphThresholdsStyleConfig,
TimeZone,
VizLegendOptions,
} from '@grafana/schema';
import { PanelContext, PanelContextProvider, SeriesVisibilityChangeMode, useTheme2 } from '@grafana/ui';
import { GraphFieldConfig } from 'app/plugins/panel/graph/types';
@ -56,6 +57,7 @@ interface Props {
thresholdsConfig?: ThresholdsConfig;
thresholdsStyle?: GraphThresholdsStyleConfig;
eventBus: EventBus;
vizLegendOverrides?: Partial<VizLegendOptions>;
}
export function ExploreGraph({
@ -76,6 +78,7 @@ export function ExploreGraph({
thresholdsConfig,
thresholdsStyle,
eventBus,
vizLegendOverrides,
}: Props) {
const theme = useTheme2();
const previousTimeRange = usePrevious(absoluteRange);
@ -180,9 +183,10 @@ export function ExploreGraph({
showLegend: true,
placement: 'bottom',
calcs: [],
...vizLegendOverrides,
},
}),
[tooltipDisplayMode]
[tooltipDisplayMode, vizLegendOverrides]
);
return (

@ -68,6 +68,9 @@ export function LogsVolumePanel(props: Props) {
return (
<div style={{ height }} className={styles.contentContainer}>
<ExploreGraph
vizLegendOverrides={{
calcs: ['sum'],
}}
graphStyle="lines"
loadingState={logsVolumeData.state ?? LoadingState.Done}
data={logsVolumeData.data}

Loading…
Cancel
Save