{
  "$schema": "https://vega.github.io/schema/vega-lite/v2.json",
  "width": 590,
  "height": 350,
  "autosize": "fit",
  "config": {
    "style": {
      "cell": {
        "stroke": "transparent"
      }
    }
  },
  "data": {
    "url": "<%= absolute_url %>data/item.json"
  },
  "resolve": {
    "scale": {
      "color": "independent"
    }
  },
  "layer": [
    {
      "mark": "bar",
      "encoding": {
        "tooltip": {
          "value": false
        },
        "y": {
          "aggregate": "sum",
          "field": "quantity",
          "type": "quantitative",
          "stack": "normalize",
          "axis": null
        },
        "x": {
          "field": "items",
          "type": "nominal",
          "scale": {
            "paddingOuter": 0.3,
            "paddingInner": 0.4
          },
          "axis": {
            "ticks": false,
            "labelAngle": 0,
            "labelPadding": 7,
            "title": null
          }
        },
        "color": {
          "field": "sub-items",
          "type": "nominal",
          "legend": null,
          "scale": {
            "range": [
              "#FFB6C1",
              "#9400D3",
              "#109618",
              "#FF9900",
              "#DC3912",
              "#3366CC"
            ]
          }
        }
      }
    },
    {
      "mark": {
        "type": "text",
        "dy": 20
      },
      "encoding": {
        "tooltip": {
          "value": false
        },
        "y": {
          "aggregate": "sum",
          "field": "quantity",
          "type": "quantitative",
          "stack": "normalize",
          "axis": null
        },
        "x": {
          "field": "items",
          "type": "nominal",
          "axis": null
        },
        "color": {
          "field": "sub-items",
          "type": "nominal",
          "scale": {
            "range": [
              "white"
            ]
          },
          "legend": null
        },
        "text": {
          "aggregate": "sum",
          "field": "quantity",
          "type": "quantitative",
          "format": ".2f"
        }
      }
    }
  ]
}
