+ {data.map((item, index) => {
+ const percentage = globalMaxValue > 0 ? (item.value / globalMaxValue) * 100 : 0;
+ const displayValue = item.value.toFixed(1);
+
+ return (
+
+ {/* Label */}
+
+ {item.label}
+
+
+ {/* Bar Container */}
+
+
+ {/* Add a subtle gradient effect for better visual appeal */}
+
+
+
+
+ {/* Value Label */}
+
+ {item.valuePrefix || ''}{formatNumber(parseFloat(displayValue))}{item.valueSuffix || '%'}
+
+
+ );
+ })}
+
+ {/* Axis Labels */}
+ {showAxisLabels && globalMaxValue > 0 && (
+
+
+
+ {formatNumber(0)}%
+ {formatNumber(Math.round(globalMaxValue / 4))}%
+ {formatNumber(Math.round(globalMaxValue / 2))}%
+ {formatNumber(Math.round((globalMaxValue * 3) / 4))}%
+ {formatNumber(Math.round(globalMaxValue))}%
+
+
+
+ )}
+