代码、数据来源于群
配置项如下
var yComparisonValue = [{
xAxis: 55,
lineStyle: {
normal: {
color: "#6acd06"
}
}
}, {
xAxis: 100,
lineStyle: {
normal: {
color: "#fbd12a"
}
}
}, {
xAxis: 150,
lineStyle: {
normal: {
color: "#fe8800"
}
}
}, {
xAxis: 200,
lineStyle: {
normal: {
color: "red"
}
}
}, {
xAxis: 300,
lineStyle: {
normal: {
color: "#c00"
}
}
}];
option = {
title: {
text: 'Dispersion of house price based on the area',
x: 'center',
y: 0,
textStyle: {
color: '#3259B8',
fontSize: 16,
fontWeight: 'normal',
}
},
visualMap: {
show: false,
min: 15202,
max: 159980,
dimension: 1,
left: 'right',
top: 'top',
text: ['HIGH', 'LOW'], // 文本,默认为数值文本
calculable: true,
itemWidth: 18,
itemHeight: 160,
textStyle: {
color: '#3259B8',
height: 56,
fontSize: 11,
lineHeight: 60,
},
inRange: {
color: ['#3EACE5', '#F02FC2']
},
padding: [50, 20],
orient: 'horizontal',
},
grid: {
left: '5%',
right: '4%',
bottom: '3%',
containLabel: true
},
tooltip: {
trigger: 'item',
showDelay: 0,
formatter: function(params) {
if (params.value.length > 1) {
return 'Area: ' +
params.value[0] + '㎡<br/> ' + 'House price: ' +
params.value[1] + ' CNY/㎡ ';
} else {
return params.seriesName + ' :<br/>' +
params.name + ' : ' +
params.value + ' CNY/㎡ ';
}
},
axisPointer: {
show: true,
type: 'cross',
lineStyle: {
type: 'dashed',
width: 1
}
}
},
xAxis: [{
type: 'value',
scale: true,
axisLabel: {
formatter: '{value} m'
},
nameTextStyle: {
color: '#3259B8',
fontSize: 14,
},
axisTick: {
show: false,
},
axisLine: {
lineStyle: {
color: '#3259B8',
}
},
splitLine: {
show: false,
}
}],
yAxis: [{
type: 'value',
scale: true,
axisLabel: {
formatter: '{value} CNY/㎡'
},
nameTextStyle: {
color: '#3259B8',
fontSize: 14
},
axisTick: {
show: false,
},
axisLine: {
lineStyle: {
color: '#3259B8',
}
},
splitLine: {
show: false,
}
}],
dataZoom: [{
type: 'slider',
show: true,
yAxisIndex: [0],
left: '93%',
start: 1,
end: 100
}, {
type: 'inside',
yAxisIndex: [0],
start: 1,
end: 100
}],
series: [{
markLine: {
data: yComparisonValue
},
name: 'price-area',
type: 'scatter',
data: [
[90.39, 49785],
[90.39, 52440],
[90.39, 98241],
[90.38, 63068],
[90.38, 58642],
[90.38, 64174],
[90.38, 106993],
[90.37, 52009],
[90.35, 30991],
[90.33, 53139],
[90.33, 44283],
[90.33, 45390],
[90.33, 47604],
[90.32, 89682],
[90.32, 86360],
[90.32, 58681],
[90.31, 57580],
[90.31, 57580],
[90.31, 73082],
[90.31, 76404],
[90.3, 42968],
[90.3, 61905],
[90.28, 76983],
[90.27, 90839],
[90.26, 60936],
[90.26, 80878],
[90.26, 53180],
[90.25, 99723],
[90.25, 36566],
[90.25, 59280],
[90.23, 36906],
[90.23, 87998],
[90.22, 36024],
[90.22, 96653],
[90.22, 33253],
[90.22, 39903],
[90.22, 39903],
[90.21, 42124],
[90.2, 59978],
[90.2, 59978],
[90.19, 42799],
[90.19, 42799],
[90.19, 138597],
[90.18, 38257],
[90.18, 38257],
[90.18, 37703],
[90.18, 37703],
[90.16, 63000],
[90.16, 46252],
[90.16, 63221],
[90.16, 52130],
[90.16, 58785],
[90.16, 55457],
[90.14, 44154],
[90.14, 43821],
[90.14, 43821],
[90.14, 89972],
[90.13, 77666],
[90.13, 35394],
[90.13, 34950],
[90.13, 44159],
[90.12, 77675],
[90.12, 96538],
[90.1, 32742],
[90.1, 33075],
[90.1, 51610],
[90.09, 36631],
[90.09, 49396],
[90.08, 94916],
[90.07, 64395],
[90.07, 53959],
[90.07, 49962],
[90.05, 52971],
[90.05, 59967],
[90.04, 95514],
[90.04, 46646],
[90.04, 46646],
[90.03, 47651],
[90.03, 49984],
[90.03, 47540],
[90.03, 47540],
[90.01, 97767],
[90.01, 41663],
[90, 45000],
[90, 45000],
[90, 95556],
[90, 45778],
[90, 84445],
[90, 33889],
[89.98, 71905],
[89.98, 124473],
[89.98, 133363],
[89.98, 56680],
[89.96, 34460],
[89.96, 33349],
[89.96, 50023],
[89.96, 45465],
[89.96, 45465],
[89.96, 83927],
[89.96, 81148],
[89.96, 44354],
[89.96, 44354],
[89.95, 32463],
[89.95, 66704],
[89.95, 68928],
[89.95, 97833],
[89.94, 67823],
[89.94, 30576],
[89.94, 86725],
[89.93, 51151],
[89.93, 104971],
[89.93, 72279],
[67.68, 63535],
[61, 52460],
[61, 94263],
[61, 139345],
[61, 53279],
[61, 100000],
[61, 117869],
[61, 47541],
[60.99, 81981],
[60.99, 69684],
[60.99, 59846],
[60.99, 89851],
[59.85, 54971],
[59.84, 35094],
[59.82, 48646],
[59.82, 48646],
[47.47, 73731],
[47.46, 34767],
[47.46, 105352],
[47.42, 27415],
[47.4, 146625],
[47.4, 150000],
[47.4, 114979],
[47.36, 74705],
[47.35, 70961],
[47.34, 90833],
[47.34, 91889],
[47.34, 99282],
[47.3, 61311],
[47.3, 144821],
[47.3, 46935],
[47.3, 46935],
[47.29, 89449],
[46.92, 83121],
[18.78, 22365],
[18.78, 23430],
[18.06, 25471],
],
symbolSize: 4,
},
]
};