Echarts将值与x标签类别对齐
我有一张散点图,上面有x记号标签。有很多,图表数据点没有与其对应的x类刻度对齐。你知道怎么排列吗?请参阅下面的图表快照 到目前为止,我有以下配置:Echarts将值与x标签类别对齐,echarts,Echarts,我有一张散点图,上面有x记号标签。有很多,图表数据点没有与其对应的x类刻度对齐。你知道怎么排列吗?请参阅下面的图表快照 到目前为止,我有以下配置: option = { xAxis: { type: 'category', name: 'x Axis', data: ["A", "B", "C"],
option = {
xAxis: {
type: 'category',
name: 'x Axis',
data: ["A", "B", "C"],
nameLocation: 'middle',
nameGap: 50,
nameTextStyle: {
fontSize: 12},
boundaryGap: false,
splitLine: {
show: true,
lineStyle: {
color: '#999',
type: 'dashed'
},
},
axisLine: {
show: false
},
axisLabel: {
interval: 0,
rotate: 30
},
},
yAxis: {
type: 'value',
name: 'y Axis',
nameLocation: 'middle',
nameGap: 70,
nameTextStyle: {
fontSize: 12
}
},
dataZoom: [{
type: 'inside'
}],
legend: {
show: true
},
grid: {
top: 80,
containLabel: true,
},
tooltip: {
trigger: "item"
},
series: [
{
id: 'Series B',
type: 'scatter',
data: [[0.11], [-0.01, 0.08, 8.02], [0.06, 0.0, 0.03]]
},
{
id: 'Series A',
type: 'scatter',
data: [[0.99, 12.76, 9.45], [9.45, 14.97], [10.66, 10.74, 10.22]...],
}]
};
表示数据点的符号实际上居中。只要你看到光学失真,它很容易检查。如果我们想要增加符号,那么失真也应该增加,对吗?我做到了 失真消失了。为什么?因为您计算机的显示器粒度太小,无法正确显示数据点。 当发生这种情况时,软件使用亚像素渲染在保持数据点形式和其视觉正确位置之间取得平衡,但结果可能会扭曲,因为无法将三个像素正确地拟合为两个 一般来说,解决这个问题并不简单,你可以。如果你想补偿失真,你可以使用这种方法
附言也可能对您有用。我理解并感谢您,您又回答了我的一个问题!