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

encoding.order sort the path not the stack for Q-Q area chart #9001

Open
yhoonkim opened this issue Jul 13, 2023 · 0 comments
Open

encoding.order sort the path not the stack for Q-Q area chart #9001

yhoonkim opened this issue Jul 13, 2023 · 0 comments
Labels

Comments

@yhoonkim
Copy link
Contributor

yhoonkim commented Jul 13, 2023

image

{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "data": {
    "values": [
      {"a": 1, "b": 2, "c": "c1"},
      {"a": 2, "b": 3, "c": "c1"},
      {"a": 3, "b": 1, "c": "c1"},
      {"a": 1, "b": 2, "c": "c2"},
      {"a": 3, "b": 1, "c": "c2"},
      {"a": 2, "b": 2, "c": "c2"}
    ]
  },
  "mark": "area",
  "encoding": {
    "x": {"field": "a", "type": "quantitative"},
    "y": {"field": "b", "type": "quantitative"},
    "color": {"field": "c"},
    "order": {"field": "c"}
  }
}

The main reason is that Area chart is not stacking with x:Q and y:Q by default so that "order" channel apply the sort on the path rather than the stacking order.

I suggest to stack by default for bar (=stacking the color even without stack def) like bar.

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

No branches or pull requests

1 participant