Skip to content
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

Merged
merged 10 commits into from
Dec 6, 2019
Merged

column demos & bugfix #1742

merged 10 commits into from
Dec 6, 2019

Conversation

hustcc
Copy link
Member

@hustcc hustcc commented Dec 4, 2019

  • 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 的时候位置不更新

@auto-add-label auto-add-label bot added the WIP label Dec 4, 2019
@todo
Copy link

todo bot commented Dec 4, 2019

现在不支持了

// TODO 现在不支持了
return ['image', imageMap[name]];
});
chart.render();


This comment was generated by todo based on a TODO comment in 5c39a12 in #1742. cc @antvis.

Copy link

@tests-checker tests-checker bot left a 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?

@antvis antvis deleted a comment from todo bot Dec 5, 2019
@antvis antvis deleted a comment from todo bot Dec 5, 2019
@antvis antvis deleted a comment from todo bot Dec 5, 2019
@hustcc hustcc changed the title WIP: column demos & bugfix column demos & bugfix Dec 5, 2019
@antvis antvis deleted a comment from todo bot Dec 5, 2019
@hustcc hustcc removed the WIP label Dec 5, 2019
@hustcc hustcc requested a review from simaQ December 5, 2019 08:51
},
});
},
});
Copy link
Contributor

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
  },
});

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

那我直接返回 container 就完了~

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

直接返回 container 居然不行,居然需要创建一个 group~

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

container 是父容器呀~ 存储所有的 shape,这里返回的是数据对应的图形,可以是 group 也可以是 shape~~~~~~~~~

Copy link
Member Author

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;
}

examples/column/basic/demo/marked.js Outdated Show resolved Hide resolved
examples/column/basic/demo/marked.js Show resolved Hide resolved

chart.data(data);
// 自定义图例
chart.legend({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

现在自定义图例,不需要声明 custom: true ?

Copy link
Member Author

@hustcc hustcc Dec 5, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不需要,没有这个配置项。之前加这个配置是需要区分什么情况吗?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

examples/column/dodge/demo/circular-stacked.js Outdated Show resolved Hide resolved
examples/column/stack/demo/wind-rose.js Outdated Show resolved Hide resolved
examples/column/stack/demo/wind-rose.js Outdated Show resolved Hide resolved
src/geometry/element/index.ts Show resolved Hide resolved
src/chart/layout/index.ts Show resolved Hide resolved
@antvis antvis deleted a comment from todo bot Dec 5, 2019
@simaQ simaQ merged commit bb96be6 into 4.x Dec 6, 2019
@simaQ simaQ deleted the demo-column branch December 6, 2019 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants