echarts 的tooltip无法显示

可芭乐 2018-03-30 05:57:19
this.axios
.post("ap", {})
.then(res => {
if (res.data.success) {
this.labelShow3 = true;
this.flowTare = [];
this.flowTare.push(
toDecimal2(
res.data.data[0].res_pool_no_used +
res.data.data[0].res_pool_used
)
);
this.flowTare.push(toDecimal2(res.data.data[0].res_pool_used));
this.flowTare.push(this.cucMonthFlow);
this.flowTare.push(this.cucDayFlow);

costPies.setOption({
title: {
text: "联通流量池扣除量(GB)",
x: "center"
},
tooltip: {
axisPointer: {
// 坐标轴指示器,坐标轴触发有效
type: "line" // 默认为直线,可选为:'line' | 'shadow'
}
},
grid: {
containLabel: true
},
color: function(params) {
let colorList = [
"#fe8463",
"#9bca63",
"#fad860",
"#60c0dd"
];
return colorList[params.dataIndex];
},
yAxis: [
{
type: "value",
name: "(GB)"
}
],
xAxis: [
{
type: "category",
data: ["A", "B", "C", "D"]
}
],
series: [
{
name: "扣除量",
type: "bar",
data: this.flowTare,
label: {
normal: {
show: true,
position: "top",
color: "#000"
}
}
}
]
});
}
});
...全文
3029 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
码上生活 2018-05-16
  • 打赏
  • 举报
回复
代码看着没问题,你看看是不是模板(html/css)哪里影响了它

52,797

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 Ajax
社区管理员
  • Ajax
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧