Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

特定数据下,无法绘制。(数据格式正确) #4164

Closed
luwenxull opened this issue Sep 28, 2016 · 3 comments
Closed

特定数据下,无法绘制。(数据格式正确) #4164

luwenxull opened this issue Sep 28, 2016 · 3 comments
Labels

Comments

@luwenxull
Copy link

特定数据的绘制异常

版本及环境 (Version & Environment)

  • ECharts 版本 (ECharts version):3.2.3
  • 浏览器类型和版本 (Browser version):5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36
  • 操作系统类型和版本 (OS Version):win 7

重现步骤 (Steps to reproduce)

1.option如下
2.调用setOption()方法

期望结果 (Expected behaviour)

无法绘制

可能哪里有问题 (What went wrong)

entity._coordSysMgr._coordinateSystems[0]._axesMap.x[0].scale._extent[1]

这个变量的小数长度达到19位,后续会调用Number.toFixed(19+2),会导致RangeError异常,下图已贴出

ECharts配置项 (ECharts option)

option={
  "tooltip": {
    "trigger": "axis",
    "axisPointer": {
      "type": "shadow"
    }
  },
  "legend": {
    "data": [
      "社交",
      "网购",
      "视频"
    ]
  },
  "grid": {
    "left": "3%",
    "right": "4%",
    "bottom": "3%",
    "containLabel": true
  },
  "xAxis": {
    "type": "value"
  },
  "yAxis": {
    "type": "category",
    "data": [
      "车主兴趣爱好"
    ]
  },
  "series": [
    {
      "name": "社交",
      "type": "bar",
      "stack": "比例",
      "label": {
        "normal": {
          "show": true,
          "position": "top"
        }
      },
      "data": [
        "0.00400"
      ]
    },
    {
      "name": "网购",
      "type": "bar",
      "stack": "比例",
      "label": {
        "normal": {
          "show": true,
          "position": "top"
        }
      },
      "data": [
        "0.00020"
      ]
    },
    {
      "name": "视频",
      "type": "bar",
      "stack": "比例",
      "label": {
        "normal": {
          "show": true,
          "position": "top"
        }
      },
      "data": [
        "0.00060"
      ]
    }
  ]
}

其他信息 (Other comments)

qq 20160928150541

@pissang
Copy link
Contributor

pissang commented Sep 28, 2016

@luwenxull
Copy link
Author

这个异常是什么我知道,这个异常是由于错误的调用toFixed方法我也知道。但是这个方法不是我主动调用的 ,是echarts内部的实现自己调用的,并且在样例option下就会出现这个异常,echarts是不是应该解决下?

@pissang pissang added the bug label Sep 29, 2016
@pissang
Copy link
Contributor

pissang commented Sep 29, 2016

Sorry 已修复

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants