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:
parent
2c4b1be806
commit
f203904aa8
|
|
@ -211,10 +211,10 @@ export function buildBarOption(
|
||||||
option.series = [
|
option.series = [
|
||||||
{
|
{
|
||||||
type: 'bar',
|
type: 'bar',
|
||||||
data: seriesData,
|
data: seriesData.map((val, idx) => ({
|
||||||
itemStyle: {
|
value: val,
|
||||||
color: style.colors[0],
|
itemStyle: { color: style.colors[idx % style.colors.length] },
|
||||||
},
|
})),
|
||||||
label,
|
label,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue