Skip to content

Commit

Permalink
legend.show enhancement $866
Browse files Browse the repository at this point in the history
  • Loading branch information
kener committed Nov 13, 2014
1 parent 858f85d commit a2b6003
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions doc/doc-en.html
Original file line number Diff line number Diff line change
Expand Up @@ -1597,6 +1597,11 @@ <h4>legend<a name="Legend"> </a></h4>
<th> Default </th>
<th> Description </th>
</tr>
<tr>
<td> <b>{boolean}</b> show </td>
<td> true </td>
<td>Specifies whether to show legend. Valid values are: true (show) | false (hide). </td>
</tr>
<tr>
<td> <b>{string}</b> orient </td>
<td> 'horizontal' </td>
Expand Down
5 changes: 5 additions & 0 deletions doc/doc.html
Original file line number Diff line number Diff line change
Expand Up @@ -1597,6 +1597,11 @@ <h4>legend<a name="Legend"> </a></h4>
<th> 默认值 </th>
<th> 描述 </th>
</tr>
<tr>
<td> <b>{boolean}</b> show </td>
<td> true </td>
<td> 显示策略,可选为:true(显示) | false(隐藏) </td>
</tr>
<tr>
<td> <b>{string}</b> orient </td>
<td> 'horizontal' </td>
Expand Down
3 changes: 3 additions & 0 deletions src/component/legend.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ define(function (require) {
Legend.prototype = {
type: ecConfig.COMPONENT_TYPE_LEGEND,
_buildShape: function () {
if (!this.legendOption.show) {
return;
}
// 图例元素组的位置参数,通过计算所得x, y, width, height
this._itemGroupLocation = this._getItemGroupLocation();

Expand Down

1 comment on commit a2b6003

@kener
Copy link
Contributor Author

@kener kener commented on a2b6003 Nov 13, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.