Add additional example with color by and x category

This commit is contained in:
Nate Kelley 2025-09-25 21:10:30 -06:00
parent 1ac26de837
commit 5dc479882c
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
1 changed files with 43 additions and 0 deletions

View File

@ -3137,6 +3137,7 @@ export const WithProblematicXAxisQuarter2: Story = {
size: [], size: [],
tooltip: null, tooltip: null,
category: [], category: [],
colorBy: null,
}, },
barGroupType: 'group', barGroupType: 'group',
metricHeader: null, metricHeader: null,
@ -3367,3 +3368,45 @@ export const WithColorByXAxis: Story = {
}, },
}, },
}; };
export const WithColorByXAndCategoryAxis: Story = {
args: {
selectedChartType: 'line',
showLegend: true,
data: ['Basketball', 'Football'].flatMap((sport, lineIndex) => {
const months = [
'Jan',
'Feb',
'Mar',
'Apr',
'May',
'Jun',
'Jul',
'Aug',
'Sep',
'Oct',
'Nov',
'Dec',
];
return months.flatMap((month, index) => {
const types = ['Home', 'Away', 'Draw'];
return types.map((type, typeIndex) => {
const test = typeIndex === 1 ? -1.5 : typeIndex * 1.25;
return {
month,
sales: 420 + (+index + lineIndex * 12 + typeIndex * 7.5) * test,
category: sport,
type,
};
});
});
}),
barAndLineAxis: {
x: ['month'],
y: ['sales'],
category: ['category'],
tooltip: null,
colorBy: { columnId: 'type' },
},
},
};