Closed hustcc closed 4 years ago
饼图数据传入为数值的时候,其中一个数值为负数的问题
const data = [
{ item: '事例一', percent: -0.4 },
{ item: '事例二', percent: 0.21 },
{ item: '事例三', percent: 0.17 },
{ item: '事例四', percent: 0.13 },
{ item: '事例五', percent: 0.09 }
];
const chart = new G2.Chart({
container: 'container',
forceFit: true,
height: 500
});
chart.source(data, {
percent: {
formatter: val => {
//val = (val 100) + '%';
return val;
}
}
});
chart.coord('theta', {
radius: 0.75
});
chart.tooltip({
showTitle: false,
itemTpl: '
axis line 和 grid 重叠的问题
这个应该是可以通过绘制顺序解决,把 grid 绘制在 backgroundGroup 层,坐标轴线绘制在 frontGroup 层
chart.tooltip()
配置项变更了哦 @simaQ 如下图。右侧 padding 为 0,鼠标离开的时候没有触发 plot:leave 事件,导致 tooltip 没有隐藏
[x] 饼图 label @simaQ
[x] 设置了起始和结束角的 theta 坐标系,自动布局时出错,复现DEMO: http://localhost:8000/zh/examples/pie/basic#pie-ranged @hustcc
chart.coordinate(‘theta’, {
startAngle: Math.PI, /// 起始角度/
endAngle: Math.PI * (3 / 2) /// 结束角度/
});
[x] 以下 3.x 接口目前不支持,为所有的图例进行配置,4.0 是否有必要支持?@hustcc
chart.legend({
offsetY: -20
});
[x] 图例布局有误 @hustcc [image:0D9D3501-C2A6-43F3-A72D-50408560C551-1525-000010EC866E5F40/A6A74650-80BB-491F-B68D-15FF6F30DEA0.png]
[x] https://github.com/antvis/G2/issues/1635 @hustcc
[x] annotation 需要支持百分比配置 @simaQ
[x] 设置了起始和结束角的 theta 坐标系,坐标轴绘制有问题,复现 demo : http://localhost:8000/zh/examples/pie/basic#pie-ranged @hustcc
[x] chart.axis() 的配置项定义未包含 grid @hustcc
[x] chart.legend() 不支持 marker: ‘circle’ 的写法,直接就绘制不出来了…复现 demo: http://localhost:8000/zh/examples/radar/radar#with-line @hustcc
chart.legend('user', {
marker: 'circle',
offsetY: -30
});
不再支持
[x] 饼图更新动画 @simaQ
[x] tooltip 交互,需要等交互语法 @simaQ
[x] 如何关闭自动布局?当用户手动设置了 padding,是否就应该按照用户设置的为准 @hustcc
只要用户定义了 items ,就以用户定义的 items 为准
下面重复
先不支持,后续有需求再加,需要 component 层级支持 https://github.com/antvis/component/issues/105 @dxq613
chart.legend({ position: 'top-center' });
设置失效 @hustcc
复现 demo: http://localhost:8000/zh/examples/gallery/bar#bar3复现 demo: http://localhost:8000/zh/examples/bar/basic#time-bar
const data = [
{ country: '巴西', population: 18203 },
{ country: '印尼', population: 23489 },
{ country: '美国', population: 29034 },
{ country: '印度', population: 104970 },
{ country: '中国', population: 131744 },
];
const div = createDiv();
div.style.display = 'inline-block';
const chart = new G2.Chart({
container: createDiv(),
width: 250,
height: 200,
});
chart.data(data);
chart.coordinate().transpose();
// chart.coordinate('polar').transpose();
chart.interval().position('country*population');
chart.render();
return ['image', imageMap[name]];
@dxq613 @zqlu
mask
属性log scale 导致的
chart.scale('exp_amo', {
type: 'log',
ticks: [225, 1000000, 2000000, 4000000, 6000000]
});
chart.axis('day', {
title: null,
grid: {
align: 'center',
lineStyle: {
lineWidth: 1,
lineDash: null,
stroke: '#f0f0f0'
},
showFirstLine: true
}
});
- [ ] gird 是否支持 align: 'center' ?
chart.axis('day', { title: null, grid: { align: 'center', lineStyle: { lineWidth: 1, lineDash: null, stroke: '#f0f0f0' }, showFirstLine: true } });
还是要支持滴~ 色块图用的着
G2 层处理
chart.legend({
reversed: boolean,
});
- [ ] slider 组件 @zqlu
@hustcc @dxq613 https://github.com/antvis/scale/pull/23 https://github.com/antvis/component/pull/118
12.30 beta 发布后添加 https://github.com/antvis/G2/projects/2#card-30956256
label
和 grid
属性支持回调geometry.label()
中属性 adjustType
默认提供的几种类型的重命名,目前 3.x adjustType 提供的三种类型:
treemap
根据包围盒大小计算,超出包围盒则不展示,这个其实不止适用于 treemap 图表,所以命名为 treemap 不太合适scatter
对重叠的文本进行调整,也不只是适用于散点图map
这个目前暂时可以只用于地图原因: 图例没有按照传入的 maxWidth 进行布局导致的。
chart.legend(false);
即可绘制正确。
@dxq613
定位到是由 clone() 函数导致
原因
:userData 数据源中有一个字段是 valsue,导致 size('value') 映射时,该条数据对应的点的 r 为 NaN,然后导致 bbox 为 NaN,最后导致局部刷新出错~~~ ref https://github.com/antvis/g/issues/343
chart.coordinate().reflect('x')
, chart.coordinate().reflect('y')
@hustcc refhttp://localhost:8000/zh/examples/heatmap/heatmap#calendar-horizontal
主要原因:4.0 的 scale 不支持 timeCat 导致的