eCharts配置项组件“tooltip”
·
“tooltip”是提示框组件,用于配置鼠标滑过或点击图表时的显示框
tooltip: {
trigger: "axis", //触发类型,'axis'坐标轴触发,'item'图形触发:散点图,饼图等无类目轴的图表中使用
axisPointer: {
//坐标轴指示器配置项
type: "shadow", //‘line’直线指示器,‘cross’十字准星指示器,‘shadow’阴影指示器
},
backgroundColor: "rgba(50,50,50,0.7)", // 提示框浮层的背景颜色。
borderColor: "#333", // 提示框浮层的边框颜色。
borderWidth: 0, // 提示框浮层的边框宽。
padding: 5, // 提示框浮层内边距,
textStyle: {
//提示框浮层上的文字样式
color: "#fff",
fontStyle: "normal",
fontWeight: "normal",
fontFamily: "sans-serif",
fontSize: 14,
},
// 提示框浮层内容格式器,支持字符串模板和回调函数两种形式。
// 模板变量有 {a}, {b},{c},分别表示系列名,数据名,数据值等
// formatter: '{a}--{b} 的成绩是 {c}'
formatter: (arg) => {
return arg[0].name + "的销量是:" + arg[0].data;
},
},
更多推荐



所有评论(0)