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

在钉钉工作台自定义组件中 使用漏斗图 图示无法正确显示 #80

Open
lhhana opened this issue Dec 26, 2020 · 0 comments

Comments

@lhhana
Copy link

lhhana commented Dec 26, 2020

  • Link:
  • Platform:
  • Mini Showcase(like screenshots):

`

onInitChart(F2, config) {

const data = [
  { action: '售前咨询', pv: 50000, percent: 1 },
  { action: '商务报价', pv: 35000, percent: 0.7 },
  { action: '售中订单', pv: 25000, percent: 0.5 },
  { action: '签约洽谈', pv: 15000, percent: 0.3 },
  { action: '签订合同', pv: 8000, percent: 0.16 }
];

const chart = new F2.Chart(config);
chart.source(data);
chart.axis(false);
chart.coord({
  transposed: true,
  scale: [ 1, -1 ]
});

chart.legend(false);
chart.intervalLabel({
  offsetX: 5,
  label: (data, color) => {
    return {
      text: data.action,
      fill: color
    };
  },

  guide: data => {
    return {
      text: (data.percent * 100).toFixed(0) + '%',
      style:{
        fill: '#fff',
      }    
    };
  }
});

chart.interval()
  .position('action*percent')
  .color('action', [ '#1959CF', '#4F8FF7', '#F39E3B', '#E7C342', '#4EAC50' ])
  .adjust('symmetric')
  .style({
    lineWidth: 2,
    stroke: '#fff'
  })
  .shape('funnel');
chart.render();
return chart`

!
QQ图片20201226133816

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

No branches or pull requests

1 participant