微信小程序在安卓机上X轴文字显示特别小,在ios上显示正常
配置项如下
option = {
title: {
text: '',
left: 'center'
},
legend: {
data: ['scatter1'],
show: false
},
color: ["#ffffff"],
grid: {
left: '2%', //图表距边框的距离
bottom: '10%',
containLabel: true
},
tooltip: {
show: true,
trigger:'axis',
position: function (point, params, dom, rect, size) {
var x = 0; // x坐标位置
var y = 0; // y坐标位置
var pointX = point[0];
var pointY = point[1];
var boxWidth = size.contentSize[0];
var boxHeight = size.contentSize[0];
if (boxWidth > pointX) {
x = 5;
} else {
x = pointX - boxWidth + 100;
}
if (boxHeight > pointY) {
y = 15;
} else {
y = pointY - boxHeight + 50;
}
return [x, y];
},
backgroundColor: '#fff',
textStyle: {
color: '#c21a17'
}
},
xAxis: {
show: true,
type: 'category',
boundaryGap: false,
data: [1,5,4,5,6],
axisLine: {
lineStyle: {
color: '#cb3431'
},
},
axisLabel: {
show: true,
textStyle: {
color: '#e69b9b'
}
},
axisTick: {
show: false
},
splitLine: {
show: false
}
// show: false
},
yAxis: {
show: false,
x: 'center',
type: 'value',
splitLine: {
lineStyle: {
type: 'dashed'
}
},
axisTick: {
show: false
},
axisLine: {
lineStyle: {
color: '#fff'
}
},
splitLine: {
show: false
}
// show: false
},
series: [{
name: 'Time',
type: 'line',
smooth: false,
symbol: '',
symbolSize: 8,
data: [1,5,4,5,6],
lineStyle: {
normal: {
color: '#fff',
width: 3,
type: 'solid'
}
},
itemStyle: {
normal: {
borderWidth: 3,
borderColor: '#fff',
color: '#cb3431'
}
}
}]
};