singleview_5_9_box-plot.vl.json 1.81 KB
Newer Older
Danyel Fisher's avatar
Danyel Fisher committed
1 2 3 4 5 6 7 8
{
  "$schema": "https://vega.github.io/schema/vega-lite/v2.json",
  "config": {"background":"#ffffff"},   
  "data": { "url": "data/cars.csv" },
  "layer": [
    {
      "mark": "rule",
      "encoding": {
9 10 11 12
        "y": {"field": "body-style", "type": "nominal",
          "axis": { "title": "Body Style"}
        },
        "x": {
Danyel Fisher's avatar
Danyel Fisher committed
13 14 15 16 17
          "aggregate": "min",
          "field": "city-mpg",
          "type": "quantitative",
          "axis": {"title": "City MPG"}
        },
18
        "x2": {
Danyel Fisher's avatar
Danyel Fisher committed
19 20 21 22 23 24 25 26 27
          "aggregate": "max",
          "field": "city-mpg",
          "type": "quantitative"
        }
      }
    },
    {
      "mark": "tick",
      "encoding": {
28 29
        "y": {"field": "body-style", "type": "nominal"},
        "x": {
Danyel Fisher's avatar
Danyel Fisher committed
30 31 32 33 34 35 36 37 38 39
          "aggregate": "min",
          "field": "city-mpg",
          "type": "quantitative"
        },
        "size": {"value": 5}
      }
    },
    {
      "mark": "tick",
      "encoding": {
40 41
        "y": {"field": "body-style", "type": "nominal"},
        "x": {
Danyel Fisher's avatar
Danyel Fisher committed
42 43 44 45 46 47 48 49 50 51
          "aggregate": "max",
          "field": "city-mpg",
          "type": "quantitative"
        },
        "size": {"value": 5}
      }
    },
    {
      "mark": "bar",
      "encoding": {
52 53
        "y": {"field": "body-style", "type": "nominal"},
        "x": {
Danyel Fisher's avatar
Danyel Fisher committed
54 55 56 57
          "aggregate": "q1",
          "field": "city-mpg",
          "type": "quantitative"
        },
58
        "x2": {
Danyel Fisher's avatar
Danyel Fisher committed
59 60 61 62 63 64 65 66 67 68
          "aggregate": "q3",
          "field": "city-mpg",
          "type": "quantitative"
        },
        "size": {"value": 5}
      }
    },
    {
      "mark": "tick",
      "encoding": {
69 70
        "y": {"field": "body-style", "type": "nominal"},
        "x": {
Danyel Fisher's avatar
Danyel Fisher committed
71 72 73 74 75 76 77 78 79 80
          "aggregate": "median",
          "field": "city-mpg",
          "type": "quantitative"
        },
        "size": {"value": 5},
        "color": { "value" : "white" }
      }
    }
  ]
}