Skip to content

Commit

Permalink
Merge pull request #90 from lklong709/PIM-44
Browse files Browse the repository at this point in the history
fixes #44 - dashboard fix bug when hover pie chart
  • Loading branch information
lunguyenhat authored Jan 12, 2023
2 parents 9bf8ac8 + a254d86 commit 5174222
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/components/PieChartComponent/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ const PieChartComponent = ({ data, colors, height, chartTitle, link, ...props })
const onPieEnter = (_, index) => {
setActiveIndex(index);
};
const onPieLeave = () => {
setActiveIndex(-1);
};
const renderActiveShape = ({
cx,
cy,
Expand Down Expand Up @@ -131,6 +134,7 @@ const PieChartComponent = ({ data, colors, height, chartTitle, link, ...props })
fill="#8884D8"
dataKey="value"
onMouseEnter={onPieEnter}
onMouseLeave={onPieLeave}
activeIndex={activeIndex}
activeShape={renderActiveShape}
>
Expand Down
4 changes: 2 additions & 2 deletions src/containers/DashboardsPage/dashboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ const Dashboard = observer(
</div>
</div>
<Row className="gx-24 mb-24">
<Col lg={6}>
<Row className="gx-24 h-100">
<Col lg={6} className={`mb-5 mb-lg-0`}>
<Row className="gx-24 h-100 gap-5 gap-lg-0">
<Col lg={6}>
<ComponentCard
title={t('txt_products')}
Expand Down

0 comments on commit 5174222

Please sign in to comment.