+ {description} +
+{isMacOs() ? "Cmd" : "Ctrl"}
;
+
+const graphTips = [
+ {
+ title: "Zoom in",
+ description: <>
+ To zoom in, hold down the {metaKey} + scroll up
, or press the +
.
+ Also, you can zoom in on a range on the graph by holding down your mouse button and selecting the range.
+ >,
+ },
+ {
+ title: "Zoom out",
+ description: <>
+ To zoom out, hold down the {metaKey} + scroll down
, or press the -
.
+ >,
+ },
+ {
+ title: "Move horizontal axis",
+ description: <>
+ To move the graph, hold down the {metaKey} + drag
the graph to the right or left.
+ >,
+ },
+ {
+ title: "Fixing a tooltip",
+ description: <>
+ To fix the tooltip, click
mouse when it's open.
+ Then, you can drag the fixed tooltip by clicking
and dragging
on the click
on a legend item to isolate it on the graph.
+ {metaKey} + click
on a legend item to remove it from the graph.
+ To revert to the previous state, click again.
+ >
+ },
+ {
+ title: "Copy key-value pairs",
+ description: <>
+ click
on a key-value pair to save it to the clipboard.
+ >
+ },
+ {
+ title: "Collapse/Expand the legend group",
+ description: <>
+ click
on the group name (e.g. Query 1: {name!=""}) to collapse or expand the legend.
+ >
+ },
+];
+
+export default graphTips.concat(legendTips);
diff --git a/app/vmui/packages/vmui/src/components/Chart/GraphTips/style.scss b/app/vmui/packages/vmui/src/components/Chart/GraphTips/style.scss
new file mode 100644
index 0000000000..d6cb69dce7
--- /dev/null
+++ b/app/vmui/packages/vmui/src/components/Chart/GraphTips/style.scss
@@ -0,0 +1,49 @@
+@use "src/styles/variables" as *;
+
+.fc-graph-tips {
+ max-width: 520px;
+ display: grid;
+ gap: $padding-global;
+
+ &-item {
+ display: grid;
+ gap: $padding-small;
+ line-height: 1.3;
+ padding-bottom: $padding-global;
+ border-bottom: $border-divider;
+
+ &__action {
+ color: $color-text-secondary;
+ font-weight: bold;
+ }
+
+ &__description {
+ display: inline-block;
+ line-height: 20px;
+
+ svg,
+ code {
+ min-height: 20px;
+ min-width: 20px;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ padding: 0 4px;
+ font-size: $font-size-small;
+ color: $color-text;
+ background-color: $color-background-body;
+ border: $border-divider;
+ border-radius: $border-radius-small;
+ margin: 0 2px 2px;
+ }
+ }
+
+ svg {
+ width: 18px;
+ color: $color-primary;
+ padding: 2px;
+ margin-top: -8px;
+ transform: translateY(8px);
+ }
+ }
+}
diff --git a/app/vmui/packages/vmui/src/components/Chart/Legend/Legend.tsx b/app/vmui/packages/vmui/src/components/Chart/Legend/Legend.tsx
index 6e394abebe..6cdc476327 100644
--- a/app/vmui/packages/vmui/src/components/Chart/Legend/Legend.tsx
+++ b/app/vmui/packages/vmui/src/components/Chart/Legend/Legend.tsx
@@ -1,6 +1,7 @@
import React, { FC, useMemo } from "preact/compat";
import { LegendItemType } from "../../../utils/uplot/types";
import LegendItem from "./LegendItem/LegendItem";
+import Accordion from "../../Main/Accordion/Accordion";
import "./style.scss";
interface LegendProps {
@@ -17,26 +18,34 @@ const Legend: FC