-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
column demos & bugfix #1742
column demos & bugfix #1742
Conversation
hustcc
commented
Dec 4, 2019
•
edited
Loading
edited
- view.legend 支持 global option
- fix undefined error when registerShape return null shape
- column demos
- polar 设置 innerRadius 属性的时候,grid 绘制错误
- wind-rose.js demo 渲染异常,localRefresh 关闭后 ok, [4.0] localRefresh 开启图形绘制不出来 G#292
- annotation 在 changeSize 的时候位置不更新
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add tests to make sure this change works as expected?
}, | ||
}); | ||
}, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
现在自定义 shape 允许返回 group 了,所以示例里面都要改一下,改成👇的:
另外原始数据可以从 cfg.data 上获取,不需要 cfg.mappingData._origin;
draw(cfg, container) {
const points = this.parsePoints(cfg.points); // 将0-1空间的坐标转换为画布坐标
const origin = cfg.data;
const value = origin.value;
const group = container.addGroup({}); // 创建一个 group
group.addShape('text', {
attrs: {
text: value,
textAlign: 'center',
x: points[1].x + cfg.size / 2,
y: points[1].y,
fontFamily: 'PingFang SC',
fontSize: 12,
fill: '#BBB',
},
}); // group 中添加 text
group.addShape('polygon', {
attrs: {
points: points.map((point) => [point.x, point.y]),
fill: cfg.color,
},
}); // group 中添加 text
return group; // 返回 group
},
});
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
那我直接返回 container 就完了~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
直接返回 container 居然不行,居然需要创建一个 group~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
container 是父容器呀~ 存储所有的 shape,这里返回的是数据对应的图形,可以是 group 也可以是 shape~~~~~~~~~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
直接返回传入的 container,导致图形画不出来。
draw(cfg, container) {
// ...
return container;
}
|
||
chart.data(data); | ||
// 自定义图例 | ||
chart.legend({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
现在自定义图例,不需要声明 custom: true ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不需要,没有这个配置项。之前加这个配置是需要区分什么情况吗?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.