您当前的位置: 首页 >  ar

echarts折线图的每个折点都显示数值

彭世瑜 发布时间:2018-06-28 14:53:43 ,浏览量:1

在 series中添加

itemStyle : { normal: {label : {show: true}}}

在django中使用echarts折线图的完整代码


var dom = document.getElementById("container");
var myChart = echarts.init(dom);
var app = {};
option = null;

result = eval({{ chart_data | safe }});

option = {
    title: {
        text: result.title,
        x: 'center',
        show : true
    },
    tooltip: {
        formatter: '{b}\n{c}'
     },
    xAxis: {
        type: 'category',
        data: result.feature
    },
    yAxis: {
        type: 'value'
    },
    series: [{
        data: result.data,
        type: 'line',
        // 显示数值
        itemStyle : { normal: {label : {show: true}}}
    }]

};


if (option && typeof option === "object") {
    myChart.setOption(option, true);
}
关注
打赏
1688896170
查看更多评论

彭世瑜

暂无认证

  • 1浏览

    0关注

    2727博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文
立即登录/注册

微信扫码登录

0.0526s