79725109

Date: 2025-08-04 15:39:10
Score: 1
Natty:
Report link

You can create a new value that combines the index and a column and then splits them when generating the axis:

alt.Chart(source).transform_calculate(
    label=alt.datum["a"] + "_" + alt.datum["index"]
).mark_bar().encode(
    alt.X("label:N", title="A").axis(labelExpr='split(datum.value, "_")[0]'),
    alt.Y("b"),
)

enter image description here

Reasons:
  • Probably link only (1):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: kgoodrick