echart横坐标X轴的值竖着显示

  axisLabel: {
            interval: 0,
            formatter: function(value) {
                //x轴的文字改为竖版显示
                var str = value.split("");
                return str.join("\n");
            },
            textStyle: {
                fontSize: 12,
                color: '#ccc'
            },
        },

整体代码如下 :

option = {
    backgroundColor: "#1A1835",
    tooltip: {
        trigger: "axis",
        axisPointer: {
            type: "shadow",
            textStyle: {
                color: "#fff"
            }

        },
    },
    grid: {
        borderWidth: 0,
        top: 140,
        bottom: 95,
        textStyle: {
            color: "#fff"
        }
    },
    legend: {
        x: '46%',
        top: '11%',
        textStyle: {
            color: '#90979c',
        },
        data: ['A', 'B']
    },


    calculable: true,
    xAxis: [{
        type: "category",
        axisLabel: {
            interval: 0,
            formatter: function(value) {
                //x轴的文字改为竖版显示
                var str = value.split("");
                return str.join("\n");
            },
            textStyle: {
                fontSize: 12,
                color: '#ccc'
            },
        },
        data: ['制造业', '建筑业', '农林牧渔', '房地产', '金融业', '居民服务及其他', '制造业', '建筑业', '农林牧渔', '房地产', '金融业', '居民服务及其他', '制造业', '建筑业', '农林牧渔', '房地产', '金融业', '居民服务及其他', '制造业', '建筑业', '农林牧渔', '房地产', '金融业', '居民服务及其他', '制造业', '建筑业', '农林牧渔', '房地产', '金融业', '居民服务及其他', '制造业', '建筑业', '农林牧渔', '房地产', '金融业', '居民服务及其他'],
    }],

    yAxis: [{
        type: "value",
        splitLine: {
            show: false
        },
        axisLine: {
            lineStyle: {
                color: "rgba(204,187,225,0.5)",
            }
        },
    }],
    series: [{
        name: "A",
        type: "effectScatter",
        symbolSize: [5, 5],
        rippleEffect: {
            period: 1,
            scale: 8,
            brushType: 'fill'
        },
        itemStyle: {
            color: new echarts.graphic.RadialGradient(0.4, 0.3, 1, [{
                offset: 0,
                color: '#FAFF52'
            }, {
                offset: 1,
                color: '#1A1835'
            }])
        },
        markPoint: {
            label: {
                normal: {
                    textStyle: {
                        color: '#fff'
                    }
                }
            },
            data: [{
                type: 'max',
                name: '最大值',

            }, {
                type: 'min',
                name: '最小值'
            }]
        },
        data: [
            59, 17, 55, 61, 29, 33, 34, 35, 28, 29, 27, 20, 55, 10, 49,
            33, 44, 28, 22, 33, 36, 33, 22, 20, 19, 25, 10, 29, 24, 28
        ],
    }, {
        name: "B",
        type: "effectScatter",
        symbolSize: [5, 5],
        rippleEffect: {
            period: 1,
            scale: 8,
            brushType: 'fill'
        },
        itemStyle: {
            // color: "#c257F6",
            color: new echarts.graphic.RadialGradient(0.4, 0.3, 1, [{
                offset: 0,
                color: '#C357F6'
            }, {
                offset: 1,
                color: '#1A1835'
            }])
        },
        markPoint: {
            label: {
                normal: {
                    textStyle: {
                        color: '#fff'
                    }
                }
            },
            data: [{
                type: 'max',
                name: '最大值',

            }, {
                type: 'min',
                name: '最小值'
            }]
        },
        data: [
            21, 36, 29, 38, 35, 34, 35, 38, 55, 43, 19, 43, 54, 35, 48, 37,
            34, 39, 38, 35, 40, 43, 54, 32, 42, 32, 38, 35, 33, 65, 42
        ]
    }, ]
}

 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值