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

支持生成chart实例以后再插入plugin #116

Closed
missjing opened this issue May 10, 2018 · 1 comment
Closed

支持生成chart实例以后再插入plugin #116

missjing opened this issue May 10, 2018 · 1 comment
Assignees

Comments

@missjing
Copy link

  • F2 Version: 3.1.6
  • Platform:
  • Mini Showcase(like screenshots):
  • CodePen Link:

目前不支持实例化后再插入plugin的方式,希望能支持,如

    import F2 from '@antv/f2/lib/core';
    import '@antv/f2/lib/geom/line';
    import Guide from '@antv/f2/lib/plugin/guide';
    import '@antv/f2/lib/component/guide';

    
    const chart = new F2.Chart({
      el: this.refs.canvas,
      width: 400,
      height: 200,
      // plugins: [ Guide ]
    });
    Guide.init(chart);
    chart.set('plugins', [ Guide ]);  // 类似于这样设置plugin
    chart.source([{name: 'city1', count: 12, { name: 'city2', count: 20 }]);
    chart.guide().text({
      position: ['city1', 12],
      content: '阿斯顿',
    });
    chart.line().position('name*count');

    chart.render();
@simaQ simaQ self-assigned this May 10, 2018
@cycgit
Copy link
Contributor

cycgit commented May 10, 2018

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants