【问题标题】:Echarts bar issuesEcharts 栏问题
【发布时间】:2017-05-22 15:51:33
【问题描述】:

我正在使用Echarts 来创建一些图表。 我的问题是,当我从toolbox 更改图表类型时,新图表超出了绘图区域。我只有bar有这个问题。

图表每秒刷新一次。

toolbox:
{
    show: true,
    feature:
    {
        magicType:
        {
            show: true,
            title:
            {
                line: "Line",
                bar: "Bar",
                tiled: "Tiled"
            },
            type: ["line", "bar", "tiled"]
        },
        restore:
        {
            show: true                
        },
        saveAsImage:
        {
            show: true
        }
    }
},

【问题讨论】:

    标签: bar-chart echarts


    【解决方案1】:

    这是因为条形图 x 轴刻度上,而不是在它们之间

    这可能是由boundaryGap: false引起的。

    Documentation on boundaryGap

    尝试将您的 x 轴设置为:

    xAxis: {
        boundaryGap : true,
    }
    

    如果您不希望标签位于 x 轴刻度之间,请使用:

    xAxis: {
        boundaryGap : true,
        xAxisTicks  : {
            alignWithLabel  : true
        }
    }
    

    Documentation on alignWithLabel

    【讨论】:

      猜你喜欢
      • 2023-03-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-01-15
      • 2013-10-10
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多