echarts 柱状图+折线图组合样式(二)

博客内容涉及Echarts图表的详细配置,包括折线图、柱状图和图例等元素的设置,用于展示数量和占比数据。通过tooltip、toolbox、xAxis和yAxis等属性定制交互和轴标签,实现数据的清晰可视化。
摘要由CSDN通过智能技术生成

 

let option = {

        tooltip: {

          trigger: "axis",

          axisPointer: {

            type: "cross",

            crossStyle: {

              color: "#999",

            },

          },

        },

        toolbox: {

          show: false,

          feature: {

            dataView: { show: true, readOnly: false },

            magicType: { show: true, type: ["line", "bar"] },

            restore: { show: true },

            saveAsImage: { show: true },

          },

        },

        xAxis: [

          {

            type: "category",

            data: this.chartx,

            axisPointer: {

              type: "shadow",

            },

          },

        ],

        yAxis: [

          {

            type: "value",

            name: "数量",

           

            

            axisLabel: {

              formatter: "{value} ",

            },

          },

          {

            type: "value",

            name: "占比",

          

           

            axisLabel: {

              formatter: "{value} %",

            },

          },

        ],

        series: [

          {

            type: "pictorialBar",

            barCategoryGap: "-230%",

            barWidth : 50,

            symbol:

              "path://M0,10 L10,10 C5.5,10 5.5,5 5,0 C4.5,5 4.5,10 0,10 z",

            itemStyle: {

              opacity: 0.8,

            },

            emphasis: {

              itemStyle: {

                opacity: 1,

              },

            },

            data: this.chartBar,

          },

          {

            type: "line",

            yAxisIndex: 1,

            data: this.chartline,

          },

        ],

      };

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值