Skip to content

Commit d6e10c7

Browse files
authored
Merge pull request #5434 from ecomfe/bar-chart
fix barMaxWidth for bar charts
2 parents e07c627 + dd7da9f commit d6e10c7

File tree

5 files changed

+377
-7
lines changed

5 files changed

+377
-7
lines changed

src/layout/barGrid.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,11 @@ define(function(require) {
9595
// Find if any auto calculated bar exceeded maxBarWidth
9696
zrUtil.each(stacks, function (column, stack) {
9797
var maxWidth = column.maxWidth;
98-
if (!column.width && maxWidth && maxWidth < autoWidth) {
98+
if (maxWidth && maxWidth < autoWidth) {
9999
maxWidth = Math.min(maxWidth, remainedWidth);
100+
if (column.width) {
101+
maxWidth = Math.min(maxWidth, column.width);
102+
}
100103
remainedWidth -= maxWidth;
101104
column.width = maxWidth;
102105
autoWidthCount--;

test/ut/core/uiHelper.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,10 @@
226226
describe(suiteName, function() {
227227
var start = isTestAll ? 0 : cases.length - 1;
228228
for (var cid = start; cid < cases.length; ++cid) {
229+
if (cases[cid].ignore) {
230+
continue;
231+
}
232+
229233
var name = specName + ' - ' + suiteName + ': '
230234
+ cases[cid].name;
231235
if (cases[cid].cases) {
@@ -236,13 +240,13 @@
236240
if (cases[cid].test === 'equalOption') {
237241
helper.expectEqualOption(name, cases[cid].option1,
238242
cases[cid].option2);
239-
helper.testOption(name + ', same as last version',
240-
cases[cid].option1);
243+
// helper.testOption(name + ', same as last version',
244+
// cases[cid].option1);
241245
} else if (cases[cid].test === 'notEqualOption') {
242246
helper.expectNotEqualOption(name, cases[cid].option1,
243247
cases[cid].option2);
244-
helper.testOption(name + ', same as last version',
245-
cases[cid].option1);
248+
// helper.testOption(name + ', same as last version',
249+
// cases[cid].option1);
246250
} else {
247251
helper.testOption(name, cases[cid].option);
248252
}

test/ut/spec/ui/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require.config({
22
paths: {
3-
'oldEcharts': 'tmp/oldEcharts',
3+
'oldEcharts': 'tmp/echarts-v3.4.0',
44
'newEcharts': '../../dist/echarts'
55
}
66
});

0 commit comments

Comments
 (0)