diff --git a/src/components/GraphPanel/GraphPanel.react.js b/src/components/GraphPanel/GraphPanel.react.js index 4d6d98812..3129c3f3d 100644 --- a/src/components/GraphPanel/GraphPanel.react.js +++ b/src/components/GraphPanel/GraphPanel.react.js @@ -76,6 +76,8 @@ const GraphPanel = ({ onGraphSelect, onNewGraph, disableAnimation = false, + hideHeader = false, + hideFooter = false, }) => { const chartRef = useRef(null); const containerRef = useRef(null); @@ -561,82 +563,84 @@ const GraphPanel = ({ return (
-
-

{currentGraphTitle}

-
- {showDropdown && ( -
- - {showGraphDropdown && ( -
- {availableGraphs.map((graph) => ( + {!hideHeader && ( +
+

{currentGraphTitle}

+
+ {showDropdown && ( +
+ + {showGraphDropdown && ( +
+ {availableGraphs.map((graph) => ( + + ))} +
- ))} -
- -
- )} -
- )} - {hasActiveGraph && onEdit && ( - - )} - {hasActiveGraph && onRefresh && ( - - )} - {onClose && ( - - )} +
+ )} +
+ )} + {hasActiveGraph && onEdit && ( + + )} + {hasActiveGraph && onRefresh && ( + + )} + {onClose && ( + + )} +
-
+ )}
{isLoading ? ( @@ -651,7 +655,7 @@ const GraphPanel = ({ )}
- {graphConfig && ( + {graphConfig && !hideFooter && (
Data points: {data?.length || 0} diff --git a/src/components/GraphPanel/GraphPanel.scss b/src/components/GraphPanel/GraphPanel.scss index dfb4dbac3..cae2a11a8 100644 --- a/src/components/GraphPanel/GraphPanel.scss +++ b/src/components/GraphPanel/GraphPanel.scss @@ -2,7 +2,6 @@ height: 100%; display: flex; flex-direction: column; - background: #fefafb; border-radius: 4px; } @@ -159,7 +158,7 @@ .chartContainer { flex: 1; padding: 16px; - min-height: 300px; + min-height: 100px; position: relative; } diff --git a/src/dashboard/Data/Browser/DataBrowser.react.js b/src/dashboard/Data/Browser/DataBrowser.react.js index d2313acab..80472a01a 100644 --- a/src/dashboard/Data/Browser/DataBrowser.react.js +++ b/src/dashboard/Data/Browser/DataBrowser.react.js @@ -2199,18 +2199,20 @@ export default class DataBrowser extends React.Component { className={styles.resizablePanel} style={{ right: aggregationPanelWidth }} > - +
+ +
); })()} diff --git a/src/dashboard/Data/Browser/Databrowser.scss b/src/dashboard/Data/Browser/Databrowser.scss index 1730a52dd..ea70ae8bf 100644 --- a/src/dashboard/Data/Browser/Databrowser.scss +++ b/src/dashboard/Data/Browser/Databrowser.scss @@ -24,6 +24,12 @@ background-color: #fefafb; } +.graphPanelContainer{ + height: 100%; + overflow: auto; + background-color: #fefafb; +} + .multiPanelWrapper { display: flex; flex-direction: row; diff --git a/src/dashboard/Data/CustomDashboard/elements/GraphConfigDialog.react.js b/src/dashboard/Data/CustomDashboard/elements/GraphConfigDialog.react.js index 97be02b1c..01322c7e6 100644 --- a/src/dashboard/Data/CustomDashboard/elements/GraphConfigDialog.react.js +++ b/src/dashboard/Data/CustomDashboard/elements/GraphConfigDialog.react.js @@ -12,6 +12,7 @@ import Label from 'components/Label/Label.react'; import Dropdown from 'components/Dropdown/Dropdown.react'; import Option from 'components/Dropdown/Option.react'; import TextInput from 'components/TextInput/TextInput.react'; +import Toggle from 'components/Toggle/Toggle.react'; const GraphConfigDialog = ({ initialConfig, @@ -21,10 +22,13 @@ const GraphConfigDialog = ({ onClose, onSave, }) => { + const [title, setTitle] = useState(initialConfig?.title || ''); const [className, setClassName] = useState(initialConfig?.className || ''); const [graphId, setGraphId] = useState(initialConfig?.graphId || ''); const [filterId, setFilterId] = useState(initialConfig?.filterId || ''); const [limit, setLimit] = useState(initialConfig?.limit?.toString() || '1000'); + const [showLegend, setShowLegend] = useState(initialConfig?.showLegend ?? true); + const [showAxisLabels, setShowAxisLabels] = useState(initialConfig?.showAxisLabels ?? true); const classesWithGraphs = useMemo(() => { return classes @@ -68,12 +72,15 @@ const GraphConfigDialog = ({ const selectedFilter = filtersForClass.find(f => f.id === filterId); onSave({ + title: title || selectedGraph?.title || 'Graph', className, graphId, graphConfig: selectedGraph, filterId: filterId || null, filterConfig: selectedFilter ? [selectedFilter] : null, limit: parseInt(limit, 10) || 1000, + showLegend, + showAxisLabels, }); }; @@ -102,6 +109,16 @@ const GraphConfigDialog = ({ /> ) : ( <> + } + input={ + + } + /> } input={ @@ -165,6 +182,30 @@ const GraphConfigDialog = ({ } /> )} + {className && graphId && ( + <> + } + input={ + + } + /> + } + input={ + + } + /> + + )} )} diff --git a/src/dashboard/Data/CustomDashboard/elements/GraphElement.react.js b/src/dashboard/Data/CustomDashboard/elements/GraphElement.react.js index b805da790..4431790c4 100644 --- a/src/dashboard/Data/CustomDashboard/elements/GraphElement.react.js +++ b/src/dashboard/Data/CustomDashboard/elements/GraphElement.react.js @@ -27,17 +27,38 @@ const GraphElement = ({ ); } + const title = config.title || config.graphConfig?.title || 'Graph'; + + // Apply overrides from config (title removed, legend and axis labels configurable) + const modifiedGraphConfig = { + ...config.graphConfig, + title: undefined, + showLegend: config.showLegend ?? config.graphConfig?.showLegend ?? true, + showAxisLabels: config.showAxisLabels ?? config.graphConfig?.showAxisLabels ?? true, + }; + return (
- +
+ {title} + {onRefresh && ( + + )} +
+
+ +
); }; diff --git a/src/dashboard/Data/CustomDashboard/elements/GraphElement.scss b/src/dashboard/Data/CustomDashboard/elements/GraphElement.scss index a450b1b52..66debf374 100644 --- a/src/dashboard/Data/CustomDashboard/elements/GraphElement.scss +++ b/src/dashboard/Data/CustomDashboard/elements/GraphElement.scss @@ -5,6 +5,46 @@ height: 100%; display: flex; flex-direction: column; + overflow: hidden; +} + +.graphHeader { + display: flex; + align-items: center; + gap: 8px; + padding: 8px 0; + border-bottom: 1px solid #e3e3ea; + flex-shrink: 0; +} + +.graphTitle { + font-size: 14px; + font-weight: 600; + color: #0e0e1a; +} + +.refreshButton { + margin-left: auto; + display: flex; + align-items: center; + justify-content: center; + width: 24px; + height: 24px; + background: transparent; + border: none; + cursor: pointer; + border-radius: 4px; + transition: background-color 0.15s ease; + + &:hover { + background-color: rgba(0, 0, 0, 0.1); + } +} + +.graphContainer { + flex: 1; + overflow: hidden; + min-height: 0; } .noConfig {