Fixed bar chart rendering issue.

This commit is contained in:
Mike Cao 2023-12-03 23:16:50 -08:00
parent e718b22599
commit 3f657d97b2

View File

@ -127,10 +127,9 @@ export function BarChart({
data: {
datasets,
},
options: getOptions() as any,
});
chart.current.options = getOptions();
onCreate?.(chart.current);
};
@ -160,7 +159,7 @@ export function BarChart({
}, [datasets, unit, theme, animationDuration, locale]);
return (
<div className={styles.container}>
<>
<div className={classNames(styles.chart, className)}>
{isLoading && <Loading position="page" icon="dots" />}
<canvas ref={canvas} />
@ -171,7 +170,7 @@ export function BarChart({
<div className={styles.tooltip}>{tooltip}</div>
</HoverTooltip>
)}
</div>
</>
);
}