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
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} annotations={queryResponse.annotations}
splitOpenFn={splitOpen} splitOpenFn={splitOpen}
loadingState={queryResponse.state} loadingState={queryResponse.state}
anchorToZero={false}
/> />
</Collapse> </Collapse>
); );

View File

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

View File

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