Ai
1 Star 0 Fork 35

匡胜昆/G2Plot

forked from antv/G2Plot 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
issue-1708-spec.ts 933 Bytes
一键复制 编辑 原始数据 按行查看 历史
hustcc 提交于 2022-11-11 19:01 +08:00 . feat: migrate to dumi-theme-antv from gatsby (#3388)
import { Area } from '../../src';
import { partySupport } from '../data/party-support';
import { createDiv } from '../utils/dom';
describe('#1708', () => {
it('area tooltip', () => {
const area = new Area(createDiv('area tooltip 重复'), {
height: 300,
data: partySupport.filter((o) => ['FF', 'Lab'].includes(o.type)),
xField: 'date',
yField: 'value',
seriesField: 'type',
legend: {
position: 'right-top',
},
tooltip: {
shared: true,
},
color: ['#6897a7', '#8bc0d6', '#60d7a7', '#dedede', '#fedca9', '#fab36f', '#d96d6f'],
line: {
size: 1,
},
point: {},
});
area.render();
let items = [];
area.on('tooltip:change', (e) => {
items = e.data.items;
});
area.chart.showTooltip({ x: 100, y: 100 });
// =2,没有重复元素
expect(items.length).toBe(2);
area.destroy();
});
});
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/17311824/g2plot.git
git@gitee.com:17311824/g2plot.git
17311824
g2plot
G2Plot
master

搜索帮助