fix formatting

This commit is contained in:
Ola Rubaj
2024-10-23 18:00:32 +02:00
parent 72f78387ce
commit 2f56b1bdc8
2 changed files with 100 additions and 96 deletions

View File

@@ -49,11 +49,11 @@ export function LineChart({
tooltip: true, tooltip: true,
}, },
data: specData, data: specData,
...(isMultiYAxis ? { ...(isMultiYAxis
transform: [ ? {
{ fold: yAxis, as: ['key', 'value'] } transform: [{ fold: yAxis, as: ['key', 'value'] }],
] }
} : {}), : {}),
selection: { selection: {
grid: { grid: {
type: 'interval', type: 'interval',
@@ -70,18 +70,22 @@ export function LineChart({
field: isMultiYAxis ? 'value' : yAxis, field: isMultiYAxis ? 'value' : yAxis,
type: yAxisType, type: yAxisType,
}, },
...(symbol ? { ...(symbol
? {
color: { color: {
field: symbol, field: symbol,
type: 'nominal' type: 'nominal',
},
} }
} : {}), : {}),
...(isMultiYAxis ? { ...(isMultiYAxis
? {
color: { color: {
field: 'key', field: 'key',
type: 'nominal' type: 'nominal',
},
} }
} : {}) : {}),
}, },
} as any; } as any;

View File

@@ -36,8 +36,9 @@ Must be an object with one of the following properties: `url` or `values` \n\n \
description: 'Type of the Y-axis', description: 'Type of the Y-axis',
}, },
symbol: { symbol: {
description: 'Name of the column header or object property that represents a series for multiple series.', description:
} 'Name of the column header or object property that represents a series for multiple series.',
},
}, },
}; };
@@ -91,7 +92,6 @@ export const MultiSeries: Story = {
}, },
}; };
export const MultiColumns: Story = { export const MultiColumns: Story = {
name: 'Line chart with multiple series (with multiple columns)', name: 'Line chart with multiple series (with multiple columns)',
args: { args: {
@@ -105,7 +105,7 @@ export const MultiColumns: Story = {
], ],
}, },
xAxis: 'year', xAxis: 'year',
yAxis: ['A', 'B', 'C'] yAxis: ['A', 'B', 'C'],
}, },
}; };