云木one 2019-08-28 10:22 采纳率: 0%
浏览 1038

js中charts中怎么设置在柱状图上方显示对应的数值?

chart中我想在柱状图的上方显示对应的数值
我在label中设置了显示,但是图形上方还是没有数据,

itemStyle: {       
normal: {        
label: {         
show: true, //开启显示         
position: 'top', //在上方显示         
textStyle: { //数值样式
color: '#fff',          
fontSize: 16  

后面我尝试加入上方的代码到下示代码后,依旧没有数值,这是咋回事

var M = $.plot($("#chongyapinfen"), [{
data: L
}], {
series: {
bars: {
show: true,
lineWidth: 20,
fill: false,
label: {
normal: {
show: true,
position: 'top',
textStyle: {
color: 'red'
}
}
},
},
points: {
show: true,
lineWidth: 3,
fill: true,
fillColor: "#fff"
},
shadowSize: 0
},
grid: {
hoverable: true,
clickable: true,
tickColor: "#aaa",
borderColor: false
},
colors: ["blue"],
xaxis: {
mode: "time",
tickFormatter: function (Q, P) {
return i[new Date(Q).getDay()];
},
color: "#222",
autoscaleMargin: 1e-18
},
yaxis: {
ticks: 4,
tickDecimals: 0,
color: "#222"
}
});
  • 写回答

1条回答 默认 最新

  • 醉生梦死bug中 2019-08-28 10:30
    关注

    这个随便百度一下也能看到吧,毕竟真的太常见。或者直接去官网看echarts的文档参数

    评论

报告相同问题?

悬赏问题

  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥15 stable diffusion
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿