echarts markPoint显示标签文字

效果图如下:

这是一个折线图,分别显示一个月、三个月、近半年以及近一年的数据。代码如下:

option = {
    color: ['#28A1E3'],
    xAxis: {
        type: 'category',
        data: ['一个月', '三个月', '近半年', '近一年']
    },
    yAxis: {
        type: 'value'
    },
    series: [{
        data: [980, 532, 901, 638],
        type: 'line',
        symbolSize: 40,
        symbol: 'circle',
        itemStyle : { 
            normal: {
                label: {
                    show: true,
                    color: '#000',
                    fontSize: 14,
                    formatter: "{b}\n\n{c}",
                    position: 'inside',
                    offset: [0, -14],
                },
                borderColor: '#217A90',
                borderWidth: 1,
            }
        },
        markPoint: {
            label: {
                show: true
            },
            symbol: 'roundRect',
            symbolOffset:[0, -20],//位置偏移
            symbolSize: 0.1,
            data : [
                {
                  symbolSize: [1, 1],
                  label: {
                    normal: {
                      show: true,
                      rich: {
                        a: {
                          color: "#FF9200"
                        }
                      }
                    },
                    emphasis: {
                      show: false
                    }
                  }
                }                
            ],
            itemStyle: {
                normal: {
                    label: {
                        show: true,
                        formatter: "{b}",
                        position: 'top',
                        textStyle: {
                            color: '#000'
                        }
                    },
                    textColor : '#000'
                },
                emphasis: {
                    label: {
                        show: true
                    }
                }
            }
        },
    }]
};

 

  • 2
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值