Skip to content

Commit

Permalink
axis.show enhancement #866
Browse files Browse the repository at this point in the history
  • Loading branch information
kener committed Nov 13, 2014
1 parent e22fe0e commit 858f85d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
6 changes: 6 additions & 0 deletions doc/doc-en.html
Expand Up @@ -2054,6 +2054,12 @@ <h4>axis<a name="Axis"> </a><a name="CategoryAxis"> </a><a name="ValueAxis"> </a
<td> universal </td>
<td> type of the coordinate axis. By default, x-axis is 'category', y-axis is 'value'. </td>
</tr>
<tr>
<td> <b>{boolean}</b> show </td>
<td> true </td>
<td> universal </td>
<td>Specifies whether to show axis. Valid values are: true (show) | false (hide). </td>
</tr>
<tr>
<td> <b>{string}</b> position </td>
<td> 'bottom' | 'left' </td>
Expand Down
6 changes: 6 additions & 0 deletions doc/doc.html
Expand Up @@ -2054,6 +2054,12 @@ <h4>axis<a name="Axis"> </a><a name="CategoryAxis"> </a><a name="ValueAxis"> </a
<td> 通用 </td>
<td> 坐标轴类型,横轴默认为类目型'category',纵轴默认为数值型'value' </td>
</tr>
<tr>
<td> <b>{boolean}</b> show </td>
<td> true </td>
<td> 通用 </td>
<td> 显示策略,可选为:true(显示) | false(隐藏) </td>
</tr>
<tr>
<td> <b>{string}</b> position </td>
<td> 'bottom' | 'left' </td>
Expand Down
4 changes: 3 additions & 1 deletion src/component/categoryAxis.js
Expand Up @@ -162,7 +162,9 @@ define(function (require) {
_buildShape : function () {
// 标签显示的挑选间隔
this._interval = this._getInterval();

if (!this.option.show) {
return;
}
this.option.splitArea.show && this._buildSplitArea();
this.option.splitLine.show && this._buildSplitLine();
this.option.axisLine.show && this._buildAxisLine();
Expand Down
3 changes: 2 additions & 1 deletion src/component/valueAxis.js
Expand Up @@ -49,9 +49,10 @@ define(function (require) {
_buildShape: function () {
this._hasData = false;
this._calculateValue();
if (!this._hasData) {
if (!this._hasData || !this.option.show) {
return;
}

this.option.splitArea.show && this._buildSplitArea();
this.option.splitLine.show && this._buildSplitLine();
this.option.axisLine.show && this._buildAxisLine();
Expand Down

0 comments on commit 858f85d

Please sign in to comment.