首页 > 解决方案 > 我如何在条形图中滚动?[图表]

问题描述

我正在使用 echart 创建 bar 我有这个问题:

我希望有固定的高度和宽度,仅在超过 5 行时才显示 5 行,它有垂直滚动 我试图在 html 中做到这一点,但数字/ xAxis 它消失了,只有当用户向下滚动时才会出现,所以我需要在echart中制作

option = {
barWidth: '30%',
barCategoryGap :'10%',
title: {
    text: 'test',
},
tooltip: {
    trigger: 'axis',
    axisPointer: {
        type: 'shadow'
    }
},

grid: {
    left: '7%',
    right: '4%',
    bottom: '40%',
    containLabel: true
},
xAxis: {
    type: 'value',
    boundaryGap: [0, 0.01]
},
yAxis: {
    type: 'category',
    data: ['Web', 'Web', 'web', 'web', 'web','web', 'web', 'web']
},
series: [
    {
        name: 'test',
        type: 'bar',
        data: [ 100, 80,30,50, 70, 100, 80,30]
    },

]

};

标签: cssangularecharts

解决方案



推荐阅读