Skip to content

Custom sort order not respected in layered plot  #5013

Open

Description

{
  "$schema": "https://vega.github.io/schema/vega-lite/v3.json",
  "description": "A simple bar chart with embedded data.",
  "data": {
    "values": [
      {"a": "A","b": 28}, {"a": "B","b": 55}
    ]
  },

  "layer": [{
    "mark": "rule",
    "encoding": {
      "x": {"field": "a", "type": "ordinal", "sort": ["B", "A"]},
      "y": {"field": "b", "type": "quantitative"}
    }
  },{
    "mark": "circle",
    "encoding": {
      "x": {"field": "a", "type": "ordinal"},
      "y": {"field": "b", "type": "quantitative"}
    }
  }]
}

image

The order should be "B, A", not "A, B".

A similar problem can be seen in #5012.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions