render({
title: "Histogram of Maximum Temperatures in Seattle from 2012 to 2015",
data: {
values: seattleWeatherData
},
params: [
{
name: 'bar_color',
value: 'purple',
bind: {
input: 'select',
options: ['purple', 'blue', 'pink', 'orange'],
labels: ['Purple Fill', 'Blue Fill', 'Pink Fill', 'Orange Fill'],
},
title: 'Bar Color: '
}
],
mark: {
type: 'bar',
color: {
expr: 'bar_color'
},
stroke: 'blue',
strokeWidth: 5,
opacity: 0.7
},
encoding: {
x: {
field: 'temp_max',
type: 'quantitative',
bin: true,
title: 'Maximum Temperature'
},
y: {
aggregate: 'count',
title: 'Num'
}
}
})