option = {
title: {
text: 'Awesome Chart'
},
xAxis: {
data: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']
},
yAxis: {},
series: [{
type: 'bar',
barWidth: '60%',
data: [10, 52, -200, 334, 390, -330, 220],
itemStyle: {
normal: {
color: function(params) {
if (params.data > 0) {
return '#1f2227'
} else {
return '#DC2625'
}
},
borderColor: function(params) {
if (params.data > 0) {
return '#0CF601'
} else {
return '#DC2625'
}
},
borderWidth: 2
}
}
}]
};