series.markPoint.label.fontSize 无法设置字体大小
如果设置markPoint.symbolSize大小,字体会跟随改字段自适应,但是还是会显示的很大
配置项如下
option = {
tooltip: {
trigger: 'none',
axisPointer: {
type: 'cross'
}
},
grid: {
left: 90,
right: 30,
top: 20,
bottom: 25
},
legend: {
data: ['收缩压', '舒张压']
},
graphic: [
{
type: 'text',
left: 'center',
top: 'center',
z: -10,
style: {
fill: '#ddd',
text: '血压记录',
font: 'bold 26px Microsoft YaHei'
}
}
],
visualMap: [
{
text: ['收缩压高', '收缩压低'],
seriesIndex: 0,
top: 5,
right: 10,
pieces: [{
lt: 90,
color: '#096'
}, {
gt: 90,
lt: 140,
color: '#ff9933'
}, {
gt: 140,
color: '#cc0033'
}],
outOfRange: {
color: '#999'
}
},
{
text: ['舒张压高', '舒张压低'],
seriesIndex: 1,
bottom: 55,
right: 10,
pieces: [{
lt: 60,
color: '#096'
}, {
gt: 60,
lt: 90,
color: '#ff9933'
}, {
gt: 90,
color: '#cc0033'
}],
outOfRange: {
color: '#999'
}
}
],
toolbox: {
orient: 'vertical',
left: 10,
showTitle: false,
itemSize: 30,
itemGap: 30,
feature: {
myTool1: {
show: true,
title: 'back',
icon: 'path://M423.68 512l167.424 167.424a33.536 33.536 0 0 1-47.36 47.36l-187.648-187.648a33.536 33.536 0 0 1-9.728-27.136 33.536 33.536 0 0 1 9.728-27.136l187.648-187.648a33.536 33.536 0 1 1 47.36 47.36z',
onclick: function () {
api.closeWin()
api.setScreenOrientation({
orientation: 'portrait_up'
});
}
},
dataZoom: {
yAxisIndex: 'none',
icon: {
zoom: 'path://m17.5,57.4828l0,-13.9138m-6.6206,6.9828l23.3966,0l0,23.0172l-23.0172,0l0,-13.3966'
}
},
restore: {},
}
},
xAxis: {
type: 'category',
axisTick: {
alignWithLabel: true
},
axisLine: {
onZero: false,
lineStyle: {
color: '#d14a61'
}
},
axisPointer: {
label: {
margin: -50,
formatter: function (params) {
if (params.seriesData.length) {
if (params.seriesData.length === 2) {
return params.value + ' 收缩压' + (params.seriesData.length ? ':' + params.seriesData[0].data + ' mmHg' : '') + ' 舒张压' + (params.seriesData.length ? ':' + params.seriesData[1].data + ' mmHg' : '');
} else {
return params.value + ' ' + params.seriesData[0].seriesName + (params.seriesData.length ? ':' + params.seriesData[0].data + ' mmHg' : '');
}
}
}
}
},
data: ["05-01", "05-02", "05-03", "05-04", "05-05", "05-06", "05-07", "05-08", "05-09", "05-10", "05-11", "05-12", "05-01", "05-02", "05-03", "05-04", "05-05", "05-06", "05-07", "05-08", "05-09", "05-10", "05-11", "05-12", "05-01", "05-02", "05-03", "05-04", "05-05", "05-06", "05-07", "05-08", "05-09", "05-10", "05-11", "05-12"]
},
yAxis: {
type: 'value'
},
dataZoom: [
{
type: 'slider',
start: 0,
end: 100,
handleSize: '200%'
},
{
type: 'inside',
start: 0,
end: 100
}
],
series: [
{
name: '收缩压',
type: 'line',
smooth: true,
data: [86, 75, 98, 125, 145, 158, 143, 132, 151, 138, 142, 121, 86, 75, 98, 125, 145, 158, 143, 132, 151, 138, 142, 121, 86, 75, 98, 125, 145, 158, 143, 132, 151, 138, 142, 121],
markPoint: {
data: [
{type: 'max', name: '最大值'},
{type: 'min', name: '最小值', itemStyle: {color: '#096'}}
]
}
},
{
name: '舒张压',
type: 'line',
smooth: true,
data: [61, 67, 79, 74, 88, 92, 98, 84, 56, 68, 75, 86, 91, 95, 88, 71, 79, 63, 88, 75, 85, 98, 75, 86, 61, 72, 68, 51, 72, 83, 68, 65, 75, 98, 75, 86],
markPoint: {
data: [
{type: 'max', name: '最大值'},
{type: 'min', name: '最小值', itemStyle: {color: '#096'}}
]
}
}
]
};