Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bar charts with null and empty string categories produces odd results #9428

Open
1 task done
rlm1023 opened this issue Sep 5, 2024 · 1 comment · May be fixed by vega/vega#3992
Open
1 task done

Bar charts with null and empty string categories produces odd results #9428

rlm1023 opened this issue Sep 5, 2024 · 1 comment · May be fixed by vega/vega#3992
Labels

Comments

@rlm1023
Copy link

rlm1023 commented Sep 5, 2024

Bug Description

Bar charts attempt to stack null and empty string categories on their y-axis, but still create distinct x-axis categories for them, leading to odd charts.

{
  "data": {
    "values": [{"a": null, "b": 28}, {"a": "", "b": 55}, {"a": "C", "b": 43}]
  },
  "mark": "bar",
  "encoding": {
    "x": {"field": "a", "type": "nominal", "axis": {"labelAngle": 0}},
    "y": {"field": "b", "type": "quantitative"}
  }
}

Produces:
chart

Repro

Checklist

  • I checked for duplicate issues.
@MarcBaeuerle
Copy link

This seems to be an issue with vega, not vega-lite. I tested the same chart but instead of having both null and "", I only used one, and got an identical Vega spec object that is returned at the end of src/compile/compile.ts (except for the naming ofc). When plugging the Vega spec object into the Vega editor, we can see the same error occurring.

Vega spec of null + "" pasted into Vega editor

same Vega spec with just null and no "" pasted into Vega editor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants