fix: Ensure metrics is an array in Mixed Chart (#24643)
This commit is contained in:
parent
b809815436
commit
fe2c14ff3a
|
|
@ -223,13 +223,13 @@ export default function transformProps(
|
|||
contributionMode ? ',.0%' : yAxisFormatSecondary,
|
||||
);
|
||||
const customFormatters = buildCustomFormatters(
|
||||
[...metrics, ...metricsB],
|
||||
[...ensureIsArray(metrics), ...ensureIsArray(metricsB)],
|
||||
currencyFormats,
|
||||
columnFormats,
|
||||
yAxisFormat,
|
||||
);
|
||||
const customFormattersSecondary = buildCustomFormatters(
|
||||
[...metrics, ...metricsB],
|
||||
[...ensureIsArray(metrics), ...ensureIsArray(metricsB)],
|
||||
currencyFormats,
|
||||
columnFormats,
|
||||
yAxisFormatSecondary,
|
||||
|
|
|
|||
|
|
@ -392,14 +392,16 @@ def create_slices(tbl: SqlaTable) -> tuple[list[Slice], list[Slice]]:
|
|||
params=get_slice_json(
|
||||
defaults,
|
||||
viz_type="mixed_timeseries",
|
||||
metrics={
|
||||
"expressionType": "SIMPLE",
|
||||
"column": {"column_name": "num", "type": "BIGINT(20)"},
|
||||
"aggregate": "AVG",
|
||||
"label": "AVG(num)",
|
||||
"optionName": "metric_vgops097wej_g8uff99zhk7",
|
||||
},
|
||||
metrics_b="sum__num",
|
||||
metrics=[
|
||||
{
|
||||
"expressionType": "SIMPLE",
|
||||
"column": {"column_name": "num", "type": "BIGINT(20)"},
|
||||
"aggregate": "AVG",
|
||||
"label": "AVG(num)",
|
||||
"optionName": "metric_vgops097wej_g8uff99zhk7",
|
||||
}
|
||||
],
|
||||
metrics_b=["sum__num"],
|
||||
granularity_sqla="ds",
|
||||
yAxisIndex=0,
|
||||
yAxisIndexB=1,
|
||||
|
|
|
|||
Loading…
Reference in New Issue