Skip to content

Commit

Permalink
fix(theme): adjust axis-line's display position.
Browse files Browse the repository at this point in the history
  • Loading branch information
simaQ committed May 2, 2018
1 parent dc5aa92 commit 423b05c
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 12 deletions.
15 changes: 10 additions & 5 deletions demos/radar-00.html
Expand Up @@ -86,16 +86,21 @@
lineDash: null
};
}
},
line: {
top: false
}
});
chart.line().position('item*score').color('user');
chart.line().position('item*score').color('user').animate({
appear: {
animation: 'groupWaveIn'
}
});
chart.point().position('item*score').color('user').style({
stroke: '#fff',
lineWidth: 1
});
}).animate({
appear: {
delay: 300
}
});;
chart.render();
</script>
</body>
Expand Down
3 changes: 0 additions & 3 deletions demos/radar-01.html
Expand Up @@ -86,9 +86,6 @@
lineDash: null
};
}
},
line: {
top: false
}
});
chart.area().position('item*score').color('user');
Expand Down
3 changes: 1 addition & 2 deletions src/theme.js
Expand Up @@ -13,8 +13,7 @@ const defaultAxis = {
},
line: {
stroke: color1,
lineWidth: 1,
top: true
lineWidth: 1
},
grid: {
stroke: color1,
Expand Down
16 changes: 14 additions & 2 deletions test/unit/chart/chart-spec.js
Expand Up @@ -345,9 +345,21 @@ describe('chart test', () => {
const axisGroup = backPlot.get('children')[0];
expect(axisGroup.get('className')).to.equal('axisContainer');

const xAxisLabel = axisGroup.get('children')[1]; // x 轴文本
const children = axisGroup.get('children');
let xAxisLabel;
let yAxisLabel;

for (let i = 0; i < children.length; i++) {
const child = children[i];
if (child._id === 'axis-x-1') {
xAxisLabel = child;
}

if (child._id === 'axis-y0-0') {
yAxisLabel = child;
}
}
const xAxisfont = xAxisLabel.attr('font');
const yAxisLabel = axisGroup.get('children')[10]; // y 轴文本
const yAxisfont = yAxisLabel.attr('font');
expect(xAxisfont).to.equal('normal normal normal 10px Arial'); // a 轴文本
expect(yAxisfont).to.equal('normal normal normal 10px "Helvetica Neue", "San Francisco", Helvetica, Tahoma, Arial, "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", sans-serif'); // b 轴文本
Expand Down

0 comments on commit 423b05c

Please sign in to comment.