From cfefe8cb6de41cabf73f09242b6fbccb1accad7d Mon Sep 17 00:00:00 2001 From: Hin Yan Liew Date: Sat, 19 Oct 2024 22:11:18 -0400 Subject: [PATCH] Fixed right margin of bar and line to not obscure the slider --- src/client/app/components/BarChartComponent.tsx | 2 +- src/client/app/components/LineChartComponent.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/app/components/BarChartComponent.tsx b/src/client/app/components/BarChartComponent.tsx index 570b21015..a11d15fc5 100644 --- a/src/client/app/components/BarChartComponent.tsx +++ b/src/client/app/components/BarChartComponent.tsx @@ -81,7 +81,7 @@ export default function BarChartComponent() { data={datasets} style={{ width: '100%', height: '100%', minHeight: '700px' }} layout={{ - margin: { t: 0, b: 0, r: 0 }, // Eliminate top, bottom, and right margins + margin: { t: 0, b: 0, r: 3 }, // Eliminate top, bottom, and right margins barmode: (barStacking ? 'stack' : 'group'), bargap: 0.2, // Gap between different times of readings bargroupgap: 0.1, // Gap between different meter's readings under the same timestamp diff --git a/src/client/app/components/LineChartComponent.tsx b/src/client/app/components/LineChartComponent.tsx index 98e05372c..36eed1908 100644 --- a/src/client/app/components/LineChartComponent.tsx +++ b/src/client/app/components/LineChartComponent.tsx @@ -78,7 +78,7 @@ export default function LineChartComponent() { data={data} style={{ width: '100%', height: '100%', minHeight: '700px' }} layout={{ - margin: { t: 0, b: 0, r: 0 }, // Eliminate top, bottom, and right margins + margin: { t: 0, b: 0, r: 3 }, // Eliminate top, bottom, and right margins autosize: true, showlegend: true, legend: { x: 0, y: 1.1, orientation: 'h' }, // 'fixedrange' on the yAxis means that dragging is only allowed on the xAxis which we utilize for selecting dateRanges