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,
},
data: specData,
...(isMultiYAxis ? {
transform: [
{ fold: yAxis, as: ['key', 'value'] }
]
} : {}),
...(isMultiYAxis
? {
transform: [{ fold: yAxis, as: ['key', 'value'] }],
}
: {}),
selection: {
grid: {
type: 'interval',
@@ -70,18 +70,22 @@ export function LineChart({
field: isMultiYAxis ? 'value' : yAxis,
type: yAxisType,
},
...(symbol ? {
...(symbol
? {
color: {
field: symbol,
type: 'nominal'
type: 'nominal',
},
}
} : {}),
...(isMultiYAxis ? {
: {}),
...(isMultiYAxis
? {
color: {
field: 'key',
type: 'nominal'
type: 'nominal',
},
}
} : {})
: {}),
},
} 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',
},
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 = {
name: 'Line chart with multiple series (with multiple columns)',
args: {
@@ -105,7 +105,7 @@ export const MultiColumns: Story = {
],
},
xAxis: 'year',
yAxis: ['A', 'B', 'C']
yAxis: ['A', 'B', 'C'],
},
};