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

饼状图bug #812

Closed
huyinghuan opened this issue Oct 23, 2014 · 3 comments
Closed

饼状图bug #812

huyinghuan opened this issue Oct 23, 2014 · 3 comments

Comments

@huyinghuan
Copy link

饼状图先加载正常数据后,显示正常,然后加载一个数组长度是1的数据后,显示正常,在加载第一次的数据后, 饼状图丢失 第一项数据的显示。
代码,截图如下
这个是options

@options =
        title:
          padding: [0, 0, 0, 0]
          grid: x: 0, y: 0, x2: 0, y2: 0
        tooltip:
          trigger: 'item'
          formatter: "{b} : {c} ({d}%)"
        legend:
          y : 'bottom',
          data:[]
        toolbox:
          show: false
        calculable: true
        series:[]

第一次数据

[
{"province":"河北","value":1061107,"name":"河北","itemStyle":{"normal":{"color":"#2f91da"}}},
{"province":"山东","value":1057335,"name":"山东","itemStyle":{"normal":{"color":"#f5ae46"}}},
{"province":"广东","value":1006668,"name":"广东","itemStyle":{"normal":{"color":"#6cbf3d"}}},
{"province":"辽宁","value":873505,"name":"辽宁","itemStyle":{"normal":{"color":"#eeeb2c"}}},
{"province":"河南","value":866622,"name":"河南","itemStyle":{"normal":{"color":"#a14ad9"}}},
{"name":"其它","value":9335932,"itemStyle":{"normal":{"color":"#f6bd0e"}}}
]

第二次数据

[{"name":"其它","value":0,"itemStyle":{"normal":{"color":"#2f91da"}}}]

第三个数据

[
{"province":"河北","value":1061107,"name":"河北","itemStyle":{"normal":{"color":"#2f91da"}}},
{"province":"山东","value":1057335,"name":"山东","itemStyle":{"normal":{"color":"#f5ae46"}}},
{"province":"广东","value":1006668,"name":"广东","itemStyle":{"normal":{"color":"#6cbf3d"}}},
{"province":"辽宁","value":873505,"name":"辽宁","itemStyle":{"normal":{"color":"#eeeb2c"}}},
{"province":"河南","value":866622,"name":"河南","itemStyle":{"normal":{"color":"#a14ad9"}}},
{"name":"其它","value":9335932,"itemStyle":{"normal":{"color":"#f6bd0e"}}}

]

第一次显示正常
1
第二次数据为空,正常
2
第三次数据和第一次一样,图形丢失
3

数据重复加载通过如下操作进行

@options.series = [{
        type: 'pie',
        radius : [20, 110],
        center : ['50%', '50%'],
        data: seriesData
      }]
      @chart.setOption @options, true
@huyinghuan
Copy link
Author

第一个图截取错了。应该是第三个图的完正确形式。 不过大概就是这个意思。

@kener
Copy link
Contributor

kener commented Oct 23, 2014

什么版本?我试了官网版本没这个问题啊,2.0.4修复了一个pie图全0数据异常,可能那个地方导致的。升级试试。
http://echarts.baidu.com/doc/changelog.html

@huyinghuan
Copy link
Author

我们用的是2.0.1 ,换成最新的后 正常了。 3Q

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

No branches or pull requests

2 participants