Skip to content

Commit

Permalink
fix: Ensure metrics is an array in Mixed Chart (#24643)
Browse files Browse the repository at this point in the history
(cherry picked from commit fe2c14f)
  • Loading branch information
kgabryje authored and michael-s-molina committed Jul 12, 2023
1 parent a15e809 commit 2bd9ca3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
18 changes: 10 additions & 8 deletions superset/examples/birth_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 2bd9ca3

Please sign in to comment.