option = {
xAxis: {
type: 'value',
boundaryGap: false
},
yAxis: {
type: 'value'
},
series: [{
data: [[5, 4],[0.5,0.5]],
type: 'scatter',
markArea: {
silent: true,
data: [
[{
coord: [0,2],
itemStyle: {
color: 'green'
},
label: {
show: true,
color: 'white',
formatter: '绿',
position: ['50%', '50%']
}
},
{
coord: [2,4]
}],
[{
coord: [4,2],
itemStyle: {
color: 'red'
},
label: {
show: true,
color: 'white',
formatter: '红',
position: ['50%', '50%']
}
},
{
coord: [2,4]
}],
[{
coord: [0,2],
itemStyle: {
color: 'yellow'
},
label: {
show: true,
color: 'white',
formatter: '绿',
position: ['50%', '50%']
}
},
{
coord: [2,0]
}],
[{
coord: [2,2],
itemStyle: {
color: 'grey'
},
label: {
show: true,
color: 'white',
formatter: '灰',
position: ['50%', '50%']
}
},
{
coord: [4,0]
}],
]
}
}]
};