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

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

Comments

Projects
None yet
2 participants
@luwenxull

特定数据的绘制异常

版本及环境 (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

@luwenxull

This comment has been minimized.

Show comment
Hide comment
@luwenxull

luwenxull Sep 29, 2016

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

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

@pissang pissang added the bug label Sep 29, 2016

@pissang pissang closed this in 761ce21 Sep 29, 2016

@pissang

This comment has been minimized.

Show comment
Hide comment
@pissang

pissang Sep 29, 2016

Contributor

Sorry 已修复

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