vegalite(
{
data: {values: data},
vconcat: [
{
mark: {type: "point",filled: "true"},
encoding:
{
x: { field: "precipitation", type: "quantitative"},
y: {field: "wind", type: "quantitative"},
tooltip: [{field: "date", type: "monthdate"}, { field: "temp_max", type: "quantitative"}],
color: {condition: {selection: "plotbrush", field: "weather", type: "nominal"}, value: "grey"}
},
selection: {plotbrush: {type: "interval",resolve: "intersect"}},
transform: [{filter: {selection: "brush"}}]
},
{
height: 100,
width: 480,
mark: "line",
encoding:
{
x: {timeUnit: "monthdate", field: "date", type: "temporal"},
y: { field: "wind", type: "quantitative", axis: {tickCount: 2, gride: false}},
color: {selection: "brush", field: "weather", type: "nominal"}
},
selection: {"brush": {encodings: ["x"], type: "interval", resolve: "intersect"}},
transform: [{filter: {selection: "plotbrush"}}]
}]
})