+2
-10
@@ -108,15 +108,6 @@ export const GraphWidgetBarChart = ({
|
||||
const [chartHeight, setChartHeight] = useState<number>(0);
|
||||
const containerRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
const debouncedSetChartDimensions = useDebouncedCallback(
|
||||
(width: number, height: number) => {
|
||||
setChartWidth(width);
|
||||
setChartHeight(height);
|
||||
},
|
||||
|
||||
300,
|
||||
);
|
||||
|
||||
const setActiveBarTooltip = useSetRecoilComponentState(
|
||||
graphWidgetBarTooltipComponentState,
|
||||
);
|
||||
@@ -363,7 +354,8 @@ export const GraphWidgetBarChart = ({
|
||||
<NodeDimensionEffect
|
||||
elementRef={containerRef}
|
||||
onDimensionChange={({ width, height }) => {
|
||||
debouncedSetChartDimensions(width, height);
|
||||
setChartWidth(width);
|
||||
setChartHeight(height);
|
||||
}}
|
||||
/>
|
||||
<ResponsiveBar
|
||||
|
||||
+1
-6
@@ -97,11 +97,6 @@ export const GraphWidgetLineChart = ({
|
||||
const containerRef = useRef<HTMLDivElement>(null);
|
||||
const [chartWidth, setChartWidth] = useState(0);
|
||||
|
||||
const debouncedSetChartWidth = useDebouncedCallback(
|
||||
(width: number) => setChartWidth(width),
|
||||
300,
|
||||
);
|
||||
|
||||
const formatOptions: GraphValueFormatOptions = {
|
||||
displayType,
|
||||
decimals,
|
||||
@@ -291,7 +286,7 @@ export const GraphWidgetLineChart = ({
|
||||
>
|
||||
<NodeDimensionEffect
|
||||
elementRef={containerRef}
|
||||
onDimensionChange={({ width }) => debouncedSetChartWidth(width)}
|
||||
onDimensionChange={({ width }) => setChartWidth(width)}
|
||||
/>
|
||||
<ResponsiveLine
|
||||
data={nivoData}
|
||||
|
||||
Reference in New Issue
Block a user