picasso.chart({
element: document.querySelector('#container'),
data,
settings: {
scales: {
years: {
data: {
extract: { field: 'Year' }
}
},
months: {
data: {
extract: { field: 'Month' }
}
},
s: {
data: {
field: 'Sales'
}
},
col: {
data: { field: 'Sales' },
type: 'color'
}
},
components: [{
key: 'y-axis',
type: 'axis',
scale: 'years',
dock: 'left'
}, {
key: 'x-axis',
type: 'axis',
scale: 'months',
dock: 'bottom'
}, {
key: 'p',
type: 'point',
data: {
extract: {
field: 'Month',
props: {
mm: { field: 'Month' },
size: { field: 'Sales' },
group: { field: 'Year' }
}
}
},
settings: {
x: { scale: 'months' },
y: { scale: 'years', ref: 'group' },
size: { scale: 's' },
fill: { scale: 'col', ref: 'size' }
}
}]
}
})