zoukankan      html  css  js  c++  java
  • echarts 实战 : 图表竖着或横着是怎样判定的?

    这个问题比较简单。

    echarts 的图表默认是竖着的。

    只要 xAxis 和 yAxis 互换,竖着的图就变成了横着的图了。

    所以我们可以可以写一个xy轴互换的方法。

      reverseXYAxis = (option) => {
        const old_x = option.xAxis
        const old_y = option.yAxis
        option.xAxis = old_y
        option.yAxis = old_x
        return option
      }
        if (settingData.xyType === "x") {
          // 一般情况
          // and more...
        } else {
          // x 轴在左边
          // and more...
    this.reverseXYAxis(option) }

    然后使用一下就 OK。

    以上。

  • 相关阅读:
    UVa-10317
    UVa-1595
    UVa-10391
    UVa-10763
    UVa-10935
    UVa-1594
    UVa-1593
    从CSDN搬过来了
    memset会显著增加时间和空间的消耗吗
    memset对数组的初始化
  • 原文地址:https://www.cnblogs.com/foxcharon/p/11875543.html
Copyright © 2011-2022 走看看