From a2b60032e1affb26fd6739f4ce006339b3cf3ee2 Mon Sep 17 00:00:00 2001 From: kener Date: Fri, 14 Nov 2014 07:05:51 +0800 Subject: [PATCH] legend.show enhancement $866 --- doc/doc-en.html | 5 +++++ doc/doc.html | 5 +++++ src/component/legend.js | 3 +++ 3 files changed, 13 insertions(+) diff --git a/doc/doc-en.html b/doc/doc-en.html index 9a7d6df413..8170ef93e5 100644 --- a/doc/doc-en.html +++ b/doc/doc-en.html @@ -1597,6 +1597,11 @@

legend

Default Description + + {boolean} show + true + Specifies whether to show legend. Valid values are: true (show) | false (hide). + {string} orient 'horizontal' diff --git a/doc/doc.html b/doc/doc.html index 34c235241f..0ed2ff6a52 100644 --- a/doc/doc.html +++ b/doc/doc.html @@ -1597,6 +1597,11 @@

legend

默认值 描述 + + {boolean} show + true + 显示策略,可选为:true(显示) | false(隐藏) + {string} orient 'horizontal' diff --git a/src/component/legend.js b/src/component/legend.js index d4798b5109..491325593e 100644 --- a/src/component/legend.js +++ b/src/component/legend.js @@ -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();