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

F2 动画插值比较对非数字不生效 #1102

Closed
zengyue opened this issue Dec 4, 2020 · 0 comments
Closed

F2 动画插值比较对非数字不生效 #1102

zengyue opened this issue Dec 4, 2020 · 0 comments

Comments

@zengyue
Copy link
Member

zengyue commented Dec 4, 2020

import F2 from '@antv/f2';

const data = [{
  date: '2017-06-05',
  value: 116
}, {
  date: '2017-06-06',
  value: 129
}, {
  date: '2017-06-07',
  value: 135
}, {
  date: '2017-06-08',
  value: 86
}, {
  date: '2017-06-09',
  value: 73
}, {
  date: '2017-06-10',
  value: 85
}, {
  date: '2017-06-11',
  value: 73
}, {
  date: '2017-06-12',
  value: 68
}];

const chart = new F2.Chart({
  id: 'container',
  pixelRatio: window.devicePixelRatio
});

chart.source(data, {
  value: {
    tickCount: 5,
    min: 0
  },
  date: {
    type: 'timeCat',
    range: [0, 1],
    tickCount: 3
  }
});
chart.tooltip({
  custom: true,
  showXTip: true,
  showYTip: true,
  snap: true,
  crosshairsType: 'xy',
  crosshairsStyle: {
    lineDash: [2]
  }
});
chart.axis('date', {
  label: function label(text, index, total) {
    const textCfg = {};
    if (index === 0) {
      textCfg.textAlign = 'left';
    } else if (index === total - 1) {
      textCfg.textAlign = 'right';
    }
    return textCfg;
  }
});
const line = chart.line().position('date*value');
chart.render();
setTimeout(() => {
  line.shape('smooth');
  // 直接调用render可以绘制,但是之前的没有清除
  // chart.render();
  // 使用repaint没有变化(原因就是animation detail diff的问题)
  chart.repaint();
}, 1000)
@zengyue zengyue closed this as completed in b1ba85e Dec 4, 2020
zengyue added a commit that referenced this issue Dec 4, 2020
fix: 修复repaint shape属性不生效。Closed #1102
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