feat: single-series bar chart uses different color per category

Each bar gets a different color from the palette, making color
palette changes immediately visible for all chart configurations.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
hailin 2026-04-05 03:07:02 -07:00
parent 2c4b1be806
commit f203904aa8
1 changed files with 4 additions and 4 deletions

View File

@ -211,10 +211,10 @@ export function buildBarOption(
option.series = [
{
type: 'bar',
data: seriesData,
itemStyle: {
color: style.colors[0],
},
data: seriesData.map((val, idx) => ({
value: val,
itemStyle: { color: style.colors[idx % style.colors.length] },
})),
label,
},
];