We would like to set a color of a marker based on the data.
For example:
.map({
markers: {
attr: {
fill: function(d) {
if (d.status === 'online') return 'green';
if (d.status === 'pending') return 'orange';
if (d.status === 'offline') return 'red';
return 'gray';
}
}
})
We would like to set a color of a marker based on the data.
For example: