explore: logs volume histogram: anchor graph to zero (#56200)

This commit is contained in:
Gábor Farkas 2022-10-04 13:54:39 +02:00 committed by GitHub
parent e942a3d99d
commit 3fb104209f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 0 deletions

View File

@ -244,6 +244,7 @@ export class Explore extends React.PureComponent<Props, ExploreState> {
annotations={queryResponse.annotations}
splitOpenFn={splitOpen}
loadingState={queryResponse.state}
anchorToZero={false}
/>
</Collapse>
);

View File

@ -53,6 +53,7 @@ interface Props {
splitOpenFn?: SplitOpen;
onChangeTime: (timeRange: AbsoluteTimeRange) => void;
graphStyle: ExploreGraphStyle;
anchorToZero: boolean;
}
export function ExploreGraph({
@ -68,6 +69,7 @@ export function ExploreGraph({
splitOpenFn,
graphStyle,
tooltipDisplayMode = TooltipDisplayMode.Single,
anchorToZero,
}: Props) {
const theme = useTheme2();
const [showAllTimeSeries, setShowAllTimeSeries] = useState(false);
@ -80,6 +82,7 @@ export function ExploreGraph({
const [fieldConfig, setFieldConfig] = useState<FieldConfigSource>({
defaults: {
min: anchorToZero ? 0 : undefined,
color: {
mode: FieldColorModeId.PaletteClassic,
},

View File

@ -130,6 +130,7 @@ export function LogsVolumePanel(props: Props) {
splitOpenFn={splitOpen}
tooltipDisplayMode={TooltipDisplayMode.Multi}
onHiddenSeriesChanged={onHiddenSeriesChanged}
anchorToZero
/>
);
} else {