{"action":"created","issue":{"url":"https://api.github.com/repos/ecomfe/echarts/issues/4254","repository_url":"https://api.github.com/repos/ecomfe/echarts","labels_url":"https://api.github.com/repos/ecomfe/echarts/issues/4254/labels{/name}","comments_url":"https://api.github.com/repos/ecomfe/echarts/issues/4254/comments","events_url":"https://api.github.com/repos/ecomfe/echarts/issues/4254/events","html_url":"https://github.com/ecomfe/echarts/issues/4254","id":182979075,"number":4254,"title":"在angular2中使用echarts init参数类型错误","user":{"login":"biolee","id":7426917,"avatar_url":"https://avatars.githubusercontent.com/u/7426917?v=3","gravatar_id":"","url":"https://api.github.com/users/biolee","html_url":"https://github.com/biolee","followers_url":"https://api.github.com/users/biolee/followers","following_url":"https://api.github.com/users/biolee/following{/other_user}","gists_url":"https://api.github.com/users/biolee/gists{/gist_id}","starred_url":"https://api.github.com/users/biolee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/biolee/subscriptions","organizations_url":"https://api.github.com/users/biolee/orgs","repos_url":"https://api.github.com/users/biolee/repos","events_url":"https://api.github.com/users/biolee/events{/privacy}","received_events_url":"https://api.github.com/users/biolee/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-14T07:12:25Z","updated_at":"2016-12-05T02:47:35Z","closed_at":null,"body":"<!--\n为了方便我们能够复现和修复 bug，请遵从下面的规范描述您的问题。\n-->\n#### 问题简述 (One-line summary)\n\n在angular2中使用echarts d.ts是DefinitelyTyped的\n#### 版本及环境 (Version & Environment)\n- ECharts 版本 (ECharts version):\"3.2.3\"\n- 浏览器类型和版本 (Browser version):chrome 53.0.2785.143 (64-bit)\n- 操作系统类型和版本 (OS Version):mac 10.12\n#### 重现步骤 (Steps to reproduce)\n\n1.安装\n`npm install typings --global\ntypings install echarts=github:DefinitelyTyped/DefinitelyTyped/echarts/echarts.d.ts#3305eb6f74a2de17d208dfaaa20d69cfb912f871 --save --global\nnpm install echarts --save`\n2.引用\n`var myChart = echarts.init(document.getElementById('test'));\n    myChart.setOption({\n      title: { text: 'ECharts 入门示例' },\n      tooltip: {},\n      xAxis: {\n        data: [\"衬衫\", \"羊毛衫\", \"雪纺衫\", \"裤子\", \"高跟鞋\", \"袜子\"]\n      },\n      yAxis: {},\n      series: [{\n        name: '销量',\n        type: 'bar',\n        data: [5, 20, 36, 10, 10, 20]\n      }]\n    });`\n\n报错：\n`Argument of type 'HTMLElement' is not assignable to parameter of type 'HTMLDivElement | HTMLCanvasElement'.\n  Type 'HTMLElement' is not assignable to type 'HTMLCanvasElement'.\n    Property 'height' is missing in type 'HTMLElement'.\n[default] Checking finished with 1 errors`\n#### 期望结果 (Expected behaviour)\n#### 可能哪里有问题 (What went wrong)\n\necharts.init 期望HTMLDivElement，但是document.getElementById('test')返回的却是HTMLElement\n#### ECharts配置项 (ECharts option)\n\n<!-- 下方贴你的option，注意不要删掉下方 ```javascript 和 尾部的 ``` 字样。\n最好是我们能够直接运行的 option。如何得到能运行的 option 参见上方的 guidelines for contributing\n-->\n\n``` javascript\noption = {\n\n}\n\n```\n#### 其他信息 (Other comments)\n\n<!-- 例如，截图或线上实例 (JSFiddle/JSBin/Codepen) (For example: Screenshot or Online demo) -->\n"},"comment":{"url":"https://api.github.com/repos/ecomfe/echarts/issues/comments/264756349","html_url":"https://github.com/ecomfe/echarts/issues/4254#issuecomment-264756349","issue_url":"https://api.github.com/repos/ecomfe/echarts/issues/4254","id":264756349,"user":{"login":"icssjs","id":221822,"avatar_url":"https://avatars.githubusercontent.com/u/221822?v=3","gravatar_id":"","url":"https://api.github.com/users/icssjs","html_url":"https://github.com/icssjs","followers_url":"https://api.github.com/users/icssjs/followers","following_url":"https://api.github.com/users/icssjs/following{/other_user}","gists_url":"https://api.github.com/users/icssjs/gists{/gist_id}","starred_url":"https://api.github.com/users/icssjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/icssjs/subscriptions","organizations_url":"https://api.github.com/users/icssjs/orgs","repos_url":"https://api.github.com/users/icssjs/repos","events_url":"https://api.github.com/users/icssjs/events{/privacy}","received_events_url":"https://api.github.com/users/icssjs/received_events","type":"User","site_admin":false},"created_at":"2016-12-05T02:47:35Z","updated_at":"2016-12-05T02:47:35Z","body":"解决没，哥们？"}}
{"actor":{"display_login":"icssjs"}}