-
Notifications
You must be signed in to change notification settings - Fork 647
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fix radar chart drawing path error. Closed #180
- Loading branch information
Showing
2 changed files
with
59 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// const expect = require('chai').expect; | ||
const F2 = require('../../src/core'); | ||
require('../../src/geom/area'); | ||
require('../../src/coord/polar'); | ||
require('../../src/component/axis/circle'); | ||
|
||
const canvas = document.createElement('canvas'); | ||
canvas.width = 500; | ||
canvas.height = 500; | ||
canvas.id = 'issue180'; | ||
document.body.appendChild(canvas); | ||
|
||
describe('issue 180', () => { | ||
it('雷达图空心问题', function() { | ||
const data = [ | ||
{ item: 'Design', user: '用户 A', score: 70 }, | ||
{ item: 'Development', user: '用户 A', score: 60 }, | ||
{ item: 'Marketing', user: '用户 A', score: 50 }, | ||
{ item: 'FKJKJG', user: '用户 A', score: 30 }, | ||
{ item: 'Design', user: '用户 B', score: 80 }, | ||
{ item: 'Development', user: '用户 B', score: 70 }, | ||
{ item: 'Marketing', user: '用户 B', score: 60 }, | ||
{ item: 'FKJKJG', user: '用户 B', score: 40 } | ||
]; | ||
const chart = new F2.Chart({ | ||
el: canvas, | ||
pixelRatio: window.devicePixelRatio | ||
}); | ||
|
||
chart.coord('polar'); | ||
chart.source(data, { | ||
score: { | ||
min: -10, | ||
tickInterval: 40 | ||
} | ||
}); | ||
|
||
chart.area().position('item*score').color('user') | ||
.shape('smooth'); | ||
chart.render(); | ||
|
||
// TODO: 这里需要进行图像测试 | ||
}); | ||
}); |