Skip to content

Commit

Permalink
fixed apache#1129
Browse files Browse the repository at this point in the history
  • Loading branch information
kener committed Jan 9, 2015
1 parent 1ad70b9 commit feaf7d7
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/chart/bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ define(function (require) {
orient == 'horizontal'
? (x = categoryAxis.getCoordByIndex(i) - gap / 2)
: (y = categoryAxis.getCoordByIndex(i) + gap / 2);

for (var j = 0, k = locationMap.length; j < k; j++) {
// 堆积数据用第一条valueAxis
yAxisIndex = series[locationMap[j][0]].yAxisIndex || 0;
Expand All @@ -104,6 +105,10 @@ define(function (require) {
counter: 0,
average: 0
};
curBarWidth = Math.min(
barMaxWidthMap[seriesIndex] || Number.MAX_VALUE,
barWidthMap[seriesIndex] || barWidth
);
if (value === '-') {
// 空数据在做完后补充拖拽提示框
continue;
Expand Down Expand Up @@ -165,10 +170,6 @@ define(function (require) {
lastP += barHeight;
}
}
var curBarWidth = Math.min(
barMaxWidthMap[seriesIndex] || Number.MAX_VALUE,
barWidthMap[seriesIndex] || barWidth
);
xMarkMap[seriesIndex][i] = orient == 'horizontal'
? (x + curBarWidth / 2)
: (y - curBarWidth / 2);
Expand Down Expand Up @@ -218,6 +219,10 @@ define(function (require) {
serie = series[seriesIndex];
data = serie.data[i];
value = this.getDataFromOption(data, '-');
curBarWidth = Math.min(
barMaxWidthMap[seriesIndex] || Number.MAX_VALUE,
barWidthMap[seriesIndex] || barWidth
);
if (value != '-') {
// 只关心空数据
continue;
Expand All @@ -233,10 +238,6 @@ define(function (require) {
lastP += this.ecTheme.island.r;
}

curBarWidth = Math.min(
barMaxWidthMap[seriesIndex] || Number.MAX_VALUE,
barWidthMap[seriesIndex] || barWidth
);
barShape = this._getBarItem(
seriesIndex, i,
categoryAxis.getNameByIndex(i),
Expand Down

0 comments on commit feaf7d7

Please sign in to comment.