{
    "$schema": "https://vega.github.io/schema/vega-lite/v4.json",
    "data": {
        "values": [
            {
                "cat": "a",
                "value": 10
            },
            {
                "cat": "b",
                "value": 5
            },
            {
                "cat": "c",
                "value": 20
            },
            {
                "cat": "d",
                "value": 8
            }
        ]
    },
    "encoding": {
        "x": {
            "field": "cat",
            "type": "nominal"
        },
        "y": {
            "field": "value",
            "type": "quantitative"
        }
    },
    "mark": {
        "color": {
            "gradient": "linear",
            "stops": [
                {
                    "color": "blue",
                    "offset": 0
                },
                {
                    "color": "red",
                    "offset": 1
                }
            ],
            "x1": 0,
            "x2": 1,
            "y1": 0,
            "y2": 1
        },
        "type": "bar"
    },
    "width": 200
}