{"action":"created","issue":{"url":"https://api.github.com/repos/ecomfe/echarts/issues/4200","repository_url":"https://api.github.com/repos/ecomfe/echarts","labels_url":"https://api.github.com/repos/ecomfe/echarts/issues/4200/labels{/name}","comments_url":"https://api.github.com/repos/ecomfe/echarts/issues/4200/comments","events_url":"https://api.github.com/repos/ecomfe/echarts/issues/4200/events","html_url":"https://github.com/ecomfe/echarts/issues/4200","id":181876365,"number":4200,"title":"legend高度设置问题","user":{"login":"YO-JLIFE","id":14227725,"avatar_url":"https://avatars.githubusercontent.com/u/14227725?v=3","gravatar_id":"","url":"https://api.github.com/users/YO-JLIFE","html_url":"https://github.com/YO-JLIFE","followers_url":"https://api.github.com/users/YO-JLIFE/followers","following_url":"https://api.github.com/users/YO-JLIFE/following{/other_user}","gists_url":"https://api.github.com/users/YO-JLIFE/gists{/gist_id}","starred_url":"https://api.github.com/users/YO-JLIFE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YO-JLIFE/subscriptions","organizations_url":"https://api.github.com/users/YO-JLIFE/orgs","repos_url":"https://api.github.com/users/YO-JLIFE/repos","events_url":"https://api.github.com/users/YO-JLIFE/events{/privacy}","received_events_url":"https://api.github.com/users/YO-JLIFE/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-09T09:15:39Z","updated_at":"2016-10-10T09:15:16Z","closed_at":null,"body":"<!--\r\n为了方便我们能够复现和修复 bug，请遵从下面的规范描述您的问题。\r\n-->\r\n#### 问题简述 (One-line summary)\r\n根据官网的配置手册，看legend的配置项中有个*height*设置组件的高度，但是我试的时候没体现出效果来，而宽度*width*的设置是起作用的。\r\n\r\n#### 版本及环境 (Version & Environment)\r\n+ ECharts 版本 (ECharts version): 最新版和直接在官方示例中修改都试过\r\n+ 浏览器类型和版本 (Browser version): 最新版chrome\r\n+ 操作系统类型和版本 (OS Version): win7\r\n\r\n\r\n#### 重现步骤 (Steps to reproduce)\r\n1.\r\n2.\r\n\r\n\r\n#### 期望结果 (Expected behaviour)\r\n\r\n\r\n\r\n#### 可能哪里有问题 (What went wrong)\r\n是不是文档没描述清楚，要配合其它配置一起用才能起作用？\r\n因为我在对legend设置*tooltip*时也遇到了个问题， 文档的描述是“*图例的 tooltip 配置，配置项同 tooltip*”，我以为是跟tooltip一样去配置legend的*tooltip*，然而我配置的时候一直都没起作用， 后面还是添加了顶级的tooltip的时候legend的*tooltip*才起作用的，类似下面的配置：\r\n```\r\n{\r\n    tooltip: {\r\n        trigger: 'item'\r\n    },\r\n    legend: {\r\n        ....\r\n        tooltip: {\r\n            show: true\r\n        }\r\n    },\r\n}\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\n\r\nvar legendData = [\r\n\t\t'option1option1option1option1option1',\r\n\t \t'option2option2option2option2option2',\r\n\t \t'option3option3option3option3option3',\r\n\t \t'option3option3option3option3option4',\r\n\t \t'option3option3option3option3option5',\r\n\t \t'option3option3option3option3option6',\r\n\t \t'option3option3option3option3option7',\r\n\t \t'option3option3option3option3option8',\r\n\t \t'option3option3option3option3option9',\r\n\t]\r\n\r\nvar xAxisData = ['Day 1', 'Day 2']\r\n\r\nvar series = []\r\n\r\n$.each(legendData, function(i, k){\r\n\tseries.push({\r\n\t\tyAxisIndex: 0,\r\n\t\tname: k,\r\n\t\ttype: 'line',\r\n\t\tdata: [\r\n\t\t\tparseInt((Math.random() + 3) *10), \r\n\t\t\tparseInt((Math.random() + 2) *10)\r\n\t\t]\r\n\t})\r\n})\r\n\r\nvar l = ['充值人数', '充值金额', '测试1']\r\n\r\noption = {\r\n    grid: [\r\n        {x: '7%', y: '20%', height: '75%'}\r\n    ],\r\n    tooltip: {\r\n        trigger: 'item'\r\n    },\r\n    legend: {\r\n        zlevel: 3,\r\n        borderColor: 'rgb(191, 191, 191)',\r\n        borderWidth: 2,\r\n\theight: 100, // 100、100px、80%这样的都试过\r\n        data: legendData,\r\n        tooltip: {\r\n            show: true\r\n        }\r\n    },\r\n    xAxis:  {\r\n        type: 'category',\r\n        boundaryGap: false,\r\n        data: xAxisData\r\n    },\r\n    yAxis: {\r\n        type: 'value',\r\n        name: '充值人数'\r\n    },\r\n    series: series\r\n}\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/252568649","html_url":"https://github.com/ecomfe/echarts/issues/4200#issuecomment-252568649","issue_url":"https://api.github.com/repos/ecomfe/echarts/issues/4200","id":252568649,"user":{"login":"YO-JLIFE","id":14227725,"avatar_url":"https://avatars.githubusercontent.com/u/14227725?v=3","gravatar_id":"","url":"https://api.github.com/users/YO-JLIFE","html_url":"https://github.com/YO-JLIFE","followers_url":"https://api.github.com/users/YO-JLIFE/followers","following_url":"https://api.github.com/users/YO-JLIFE/following{/other_user}","gists_url":"https://api.github.com/users/YO-JLIFE/gists{/gist_id}","starred_url":"https://api.github.com/users/YO-JLIFE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YO-JLIFE/subscriptions","organizations_url":"https://api.github.com/users/YO-JLIFE/orgs","repos_url":"https://api.github.com/users/YO-JLIFE/repos","events_url":"https://api.github.com/users/YO-JLIFE/events{/privacy}","received_events_url":"https://api.github.com/users/YO-JLIFE/received_events","type":"User","site_admin":false},"created_at":"2016-10-10T09:15:16Z","updated_at":"2016-10-10T09:15:16Z","body":"- - 仔细看源码发现问题了， 是`orient=\"horizontal\"`的时候，只有width会起作用，height为auto；`orient=\"vertical\"`的时候只有height会起作用，width为auto。\r\n\r\n感觉文档方面要多多完善才行啊，而且讲道理的话， 一般都不会有人希望legend的宽度会超出整个图吧~"}}
{"actor":{"display_login":"YO-JLIFE"}}