-
Notifications
You must be signed in to change notification settings - Fork 605
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: 双轴图 point 颜色映射错误和参数丢失 * fix: conversation * fix: test Co-authored-by: liufu.lf <liufu.lf@antfin.com>
- Loading branch information
Showing
2 changed files
with
96 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
import { DualAxes } from '../../../../src'; | ||
import { PV_DATA_MULTI, UV_DATA_MULTI } from '../../../data/pv-uv'; | ||
import { createDiv } from '../../../utils/dom'; | ||
|
||
describe('point', () => { | ||
it('point style', () => { | ||
const dualAxes = new DualAxes(createDiv('test DualAxes point'), { | ||
width: 400, | ||
height: 500, | ||
data: [PV_DATA_MULTI, UV_DATA_MULTI], | ||
xField: 'date', | ||
yField: ['pv', 'uv'], | ||
geometryOptions: [ | ||
{ | ||
geometry: 'column', | ||
seriesField: 'site', | ||
isStack: true, | ||
}, | ||
{ | ||
geometry: 'line', | ||
seriesField: 'site', | ||
isStack: true, | ||
point: { | ||
style: () => ({ fill: 'red' }), | ||
}, | ||
}, | ||
], | ||
}); | ||
|
||
dualAxes.render(); | ||
|
||
const element = dualAxes.chart.views[1].geometries[1].elements[0]; | ||
expect(element.getModel().shape).toBe('circle'); | ||
expect(element.getData().site).toBeDefined(); | ||
expect(element.getModel().style.fill).toBe('red'); | ||
}); | ||
it('point false', () => { | ||
const dualAxes = new DualAxes(createDiv('test DualAxes point false'), { | ||
width: 400, | ||
height: 500, | ||
data: [PV_DATA_MULTI, UV_DATA_MULTI], | ||
xField: 'date', | ||
yField: ['pv', 'uv'], | ||
geometryOptions: [ | ||
{ | ||
geometry: 'column', | ||
seriesField: 'site', | ||
isStack: true, | ||
}, | ||
{ | ||
geometry: 'line', | ||
seriesField: 'site', | ||
isStack: true, | ||
point: false, | ||
}, | ||
], | ||
}); | ||
|
||
dualAxes.render(); | ||
const element = dualAxes.chart.views[1].geometries[1]; | ||
expect(element).toBeUndefined(); | ||
}); | ||
|
||
it('point undefined', () => { | ||
const dualAxes = new DualAxes(createDiv('test DualAxes point undefined'), { | ||
width: 400, | ||
height: 500, | ||
data: [PV_DATA_MULTI, UV_DATA_MULTI], | ||
xField: 'date', | ||
yField: ['pv', 'uv'], | ||
geometryOptions: [ | ||
{ | ||
geometry: 'column', | ||
seriesField: 'site', | ||
isStack: true, | ||
}, | ||
{ | ||
geometry: 'line', | ||
seriesField: 'site', | ||
isStack: true, | ||
}, | ||
], | ||
}); | ||
|
||
dualAxes.render(); | ||
const element = dualAxes.chart.views[1].geometries[1]; | ||
expect(element).toBeUndefined(); | ||
}); | ||
}); |
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