Vaibhav_Dashboard_Enhancement #9

Merged
vikas.nale merged 6 commits from Vaibhav_Dashboard_Enhancement into Feature_Task_Management 2025-04-15 11:42:46 +00:00
Showing only changes of commit 19df5a55ff - Show all commits

View File

@ -46,19 +46,23 @@ const HorizontalBarChart = ({
// Replace 0 with 1 for visual purposes, but display "0%" in labels // Replace 0 with 1 for visual purposes, but display "0%" in labels
const adjustedSeriesData = sortedSeriesData.map(val => (val === 0 ? 1 : val)); const adjustedSeriesData = sortedSeriesData.map(val => (val === 0 ? 1 : val));
// Dynamically adjust chart height if only one data point
const chartHeight = seriesData.length === 1 ? 80 : 380;
const chartOptions = { const chartOptions = {
chart: { chart: {
type: "bar", type: "bar",
height: 380, height: chartHeight,
toolbar: { show: false }, toolbar: { show: false },
}, },
grid: { show: false }, grid: { show: false },
plotOptions: { plotOptions: {
bar: { bar: {
barHeight: "60%", barHeight: seriesData.length === 1 ? "30%" : "60%",
distributed: true, distributed: true,
horizontal: true, horizontal: true,
borderRadius: 10, borderRadius: 3,
borderRadiusApplication: "end",
dataLabels: { dataLabels: {
position: "top", position: "top",
}, },
@ -110,7 +114,7 @@ const HorizontalBarChart = ({
options={chartOptions} options={chartOptions}
series={[{ data: adjustedSeriesData }]} series={[{ data: adjustedSeriesData }]}
type="bar" type="bar"
height={380} height={chartHeight}
/> />
</div> </div>
); );