Echarts区域堆叠面积图,反向

效果图 :

 代码:

var CarckLongOption = {
        title: {
            left: 'center',
            text: '裂缝半长延伸图',
            textStyle: {
                fontSize: 13
            }
        },
        grid: {
            top: '25px',
            bottom: '20px',
            left: '20px',
            right: '10px',
            containLabel: true
        },
        tooltip: {
            trigger: 'axis',
            //axisPointer: {
            //    axis: 'y'
            //},
            //formatter: function (data) {
            //    var params = data[0];
            //    return "井深:" + params.value[1].toFixed(1) + "米<br>井筒温度:" + params.value[0].toFixed(1) + "℃";
            //}
        },
        xAxis: {
            type: 'value',
            name: '裂缝半长(m)',
            nameGap: '25',
            nameLocation: 'center',
            //data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
        },
        yAxis: {
            type: 'category',
            name: '缝高(m)',
            nameGap: '30',
            nameLocation: 'center',
            position: 'top',
        },
        series: [
            {
                data: [[150, 0], [180, 10], [200, 20], [218, 30], [200, 40], [180, 50], [150, 60]],
                type: 'line',
                showSymbol: false,
                areaStyle: {},
                smooth: true
            },
            {
                data: [[130, 0], [160, 10], [180, 20], [198, 30], [180, 40], [160, 50], [130, 60]],
                type: 'line',
                showSymbol: false,
                areaStyle: {},
                smooth: true
            },
            {
                data: [[110, 0], [140, 10], [160, 20], [178, 30], [160, 40], [140, 50], [110, 60]],
                type: 'line',
                showSymbol: false,
                areaStyle: {},
                smooth: true
            }
        ]
    };
    CarckLongChart = echarts.init(document.getElementById('CarckLongChart'), { renderer: 'svg' });
    CarckLongChart.setOption(CarckLongOption);

重点就在x轴和y轴的type上。 series里面的areaStyle可根据需求自行设置。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值