picasso.chart({
element: document.querySelector('#container'),
data,
settings: {
components: [
...data
.slice(type === '-1' ? 1 : 1 + +type, type === '-1' ? 4 : 2 + +type)
.map((row, i, a) => [
arc([1], i, colors[row[0]], true),
arc([row[1], row[2] - row[1]], i, colors[row[0]])
])
.reduce((a, v) => a.concat(v), []),
type === '-1' ? false : label()
].filter(Boolean)
}
})