{"action":"created","issue":{"url":"https://api.github.com/repos/ecomfe/echarts/issues/2747","repository_url":"https://api.github.com/repos/ecomfe/echarts","labels_url":"https://api.github.com/repos/ecomfe/echarts/issues/2747/labels{/name}","comments_url":"https://api.github.com/repos/ecomfe/echarts/issues/2747/comments","events_url":"https://api.github.com/repos/ecomfe/echarts/issues/2747/events","html_url":"https://github.com/ecomfe/echarts/issues/2747","id":138876748,"number":2747,"title":"echart.setOption报错： Series is not initialized. Please depends sereis.","user":{"login":"shikelong","id":4499997,"avatar_url":"https://avatars.githubusercontent.com/u/4499997?v=3","gravatar_id":"","url":"https://api.github.com/users/shikelong","html_url":"https://github.com/shikelong","followers_url":"https://api.github.com/users/shikelong/followers","following_url":"https://api.github.com/users/shikelong/following{/other_user}","gists_url":"https://api.github.com/users/shikelong/gists{/gist_id}","starred_url":"https://api.github.com/users/shikelong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shikelong/subscriptions","organizations_url":"https://api.github.com/users/shikelong/orgs","repos_url":"https://api.github.com/users/shikelong/repos","events_url":"https://api.github.com/users/shikelong/events{/privacy}","received_events_url":"https://api.github.com/users/shikelong/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-03-07T03:37:51Z","updated_at":"2016-03-07T03:57:54Z","closed_at":"2016-03-07T03:57:54Z","body":"<!--\r\n为了方便我们能够复现和修复 bug，请遵从下面的规范描述您的问题。\r\n-->\r\n#### 问题简述 (One-line summary)\r\n\r\nechart.setOption报错： Series is not initialized. Please depends sereis. Options如下。\r\n\r\n提供给options对象的外部参数piedata数据为对象数组，格式如下\r\n```\r\n[\r\n    {\r\n        \"rp_type\": 2,\r\n        \"name\": \"压疮报告表\",\r\n        \"code\": \"-1\",\r\n        \"value\": 12,\r\n        \"degree\": 0\r\n    },\r\n    {\r\n        \"rp_type\": 3,\r\n        \"name\": \"高危压疮报告表\",\r\n        \"code\": \"-1\",\r\n        \"value\": 20,\r\n        \"degree\": 0\r\n    }\r\n]\r\n```\r\n\r\n无数据的时候其值可能为 []\r\n\r\n#### 版本及环境 (Version & Environment)\r\n+ ECharts 版本 (ECharts version):  3.1.2\r\n+ 浏览器类型和版本 (Browser version):   50.0.2661.11 dev-m (64-bit\r\n+ 操作系统类型和版本 (OS Version): windows 10\r\n\r\n\r\n#### 重现步骤 (Steps to reproduce)\r\n1.  series data参数为[]的情况下。调用多次 获取dom容器->初始化echart对象->setOption的过程时候，可能有某次报错。 非100%重现。\r\n2.   series data参数不为空的情况下，调用多次 获取dom容器->初始化echart对象->setOption的过程时候，可能有某次报错。非100%重现。\r\n3. 一旦报错以后，除非刷新页面。 继续调用 获取dom容器->初始化echart对象->setOption的过程。图表始终不会出现\r\n\r\n\r\n#### 期望结果 (Expected behaviour)\r\n\r\n期望无报错。正常渲染图表\r\n\r\n\r\n#### 可能哪里有问题 (What went wrong)\r\n\r\n不知道。\r\n\r\n#### ECharts配置项 (ECharts option)\r\n<!-- 下方贴你的option，注意不要删掉下方 ```javascript 和 尾部的 ``` 字样。\r\n最好是我们能够直接运行的 option。如何得到能运行的 option 参见上方的 guidelines for contributing\r\n-->\r\n```javascript\r\noption = {\r\n  title: {\r\n                text: titlename,\r\n                x: 'center'\r\n            },\r\n            tooltip: {\r\n                trigger: 'item', // 触发类型，默认数据触发，可选为：'axis'\r\n                formatter: \"{b} : {c} ({d}%)\",\r\n                textStyle: {\r\n                    fontSize: 16\r\n                }\r\n            },\r\n            legend: {\r\n                /*padding: 20, // 图例内边距，单位px，默认上下左右内边距为5\r\n                itemGap: 5, // Legend各个item之间的间隔，横向布局时为水平间隔，纵向布局时为纵向间隔*/\r\n                left: 'left',\r\n                orient: 'vertical',\r\n                data: lengendName\r\n            },\r\n            toolbox: {\r\n                show: false\r\n            },\r\n            calculable: false,\r\n            series: [{\r\n                name: '上报事件', // 系列名称\r\n                type: 'pie', // 图表类型，折线图line、散点图scatter、柱状图bar、饼图pie、雷达图radar  \r\n                //   radius: '60%',\r\n                selectedMode: 'single',\r\n                center: ['50%', '50%'],\r\n                data: piedata,\r\n                itemStyle: {\r\n                    normal: {}\r\n                },\r\n                label: {\r\n                    normal: {\r\n                        show: true,\r\n                        formatter: \"{b}:{c}\",\r\n                        position: \"inner\",\r\n                        textStyle: {\r\n                            fontSize: 15\r\n                        }\r\n                    }\r\n\r\n                }\r\n            }],\r\n            animation: false\r\n}\r\n\r\n```\r\n\r\n\r\n#### 其他信息 (Other comments)\r\n<!-- 例如，截图或线上实例 (JSFiddle/JSBin/Codepen) (For example: Screenshot or Online demo) -->\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/ecomfe/echarts/issues/comments/193082836","html_url":"https://github.com/ecomfe/echarts/issues/2747#issuecomment-193082836","issue_url":"https://api.github.com/repos/ecomfe/echarts/issues/2747","id":193082836,"user":{"login":"shikelong","id":4499997,"avatar_url":"https://avatars.githubusercontent.com/u/4499997?v=3","gravatar_id":"","url":"https://api.github.com/users/shikelong","html_url":"https://github.com/shikelong","followers_url":"https://api.github.com/users/shikelong/followers","following_url":"https://api.github.com/users/shikelong/following{/other_user}","gists_url":"https://api.github.com/users/shikelong/gists{/gist_id}","starred_url":"https://api.github.com/users/shikelong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shikelong/subscriptions","organizations_url":"https://api.github.com/users/shikelong/orgs","repos_url":"https://api.github.com/users/shikelong/repos","events_url":"https://api.github.com/users/shikelong/events{/privacy}","received_events_url":"https://api.github.com/users/shikelong/received_events","type":"User","site_admin":false},"created_at":"2016-03-07T03:57:54Z","updated_at":"2016-03-07T03:57:54Z","body":"谢谢。是的，和chrome 50有关系。\r\n在chrome v-39稳定版下进行了测试。不会出现这个问题。"}}