(feat:barGraph) on hover opacity

This commit is contained in:
ManishMadan2882
2025-03-01 20:14:27 +05:30
parent a3b28843b6
commit f66ef05f2a

View File

@@ -450,5 +450,17 @@ function AnalyticsChart({
},
},
};
return <Bar options={options} plugins={[htmlLegendPlugin]} data={data} />;
return (
<Bar
options={options}
plugins={[htmlLegendPlugin]}
data={{
...data,
datasets: data.datasets.map((dataset) => ({
...dataset,
hoverBackgroundColor: `${dataset.backgroundColor}CC`, // 80% opacity
})),
}}
/>
);
}