analytics
@@ -497,6 +502,56 @@
}
}
};
+
+ // Chart Resizer Logic
+ document.addEventListener('DOMContentLoaded', () => {
+ const resizer = document.getElementById('mainChartResizer');
+ const chartWrapper = document.getElementById('chartWrapper');
+
+ let isResizing = false;
+ let lastDownY = 0;
+
+ if (resizer && chartWrapper) {
+ resizer.addEventListener('mousedown', (e) => {
+ isResizing = true;
+ lastDownY = e.clientY;
+ document.body.style.cursor = 'row-resize';
+ chartWrapper.style.pointerEvents = 'none'; // Prevent iframe/canvas capturing mouse
+ });
+
+ document.addEventListener('mousemove', (e) => {
+ if (!isResizing) return;
+
+ const deltaY = e.clientY - lastDownY;
+ lastDownY = e.clientY;
+
+ const newHeight = chartWrapper.offsetHeight + deltaY;
+
+ // Min 200px, Max windowHeight - 150px
+ if (newHeight > 200 && newHeight < window.innerHeight - 150) {
+ chartWrapper.style.flex = 'none';
+ chartWrapper.style.height = newHeight + 'px';
+
+ // Force chart layout recalculation if applicable
+ if (window.dashboard && window.dashboard.chart) {
+ const container = document.getElementById('chart');
+ window.dashboard.chart.applyOptions({
+ width: container.clientWidth,
+ height: container.clientHeight
+ });
+ }
+ }
+ });
+
+ document.addEventListener('mouseup', () => {
+ if (isResizing) {
+ isResizing = false;
+ document.body.style.cursor = '';
+ chartWrapper.style.pointerEvents = 'auto';
+ }
+ });
+ }
+ });