option = {
grid: {
left: '10%',
right: '10%',
bottom: '10%'
},
tooltip: {
show: true,
trigger: 'axis',
axisPointer: {
type: 'cross', // 设置坐标轴指示器的类型为十字准星
label: {
show: true, // 显示坐标轴指示器的标签
precision: 2 // 标签显示的小数位数
}
}
},
xAxis: {
type: 'category',
data: ['Category1', 'Category2', 'Category3', 'Category4', 'Category5']
},
yAxis: {
type: 'value'
},
series: [
{
name: 'Series1',
type: 'line',
data: [5, 20, 36, 10, 10]
}
]
};
在上述配置中,axisPointer 配置项用于配置坐标轴指示器的相关属性。type 属性指定了坐标轴指示器的类型,这里设置为 'cross' 表示十字准星指示器。label 配置项用于配置坐标轴指示器标签的显示,show 属性表示是否显示标签,precision 属性表示标签显示的小数位数。
你可以根据需要调整这些属性以满足你的要求。
转载请注明出处:http://www.zyzy.cn/article/detail/5142/ECharts