Skip to content

Bug: animation speed with animation step #192

@x1c0

Description

@x1c0

when setting animationStep > 1 then the progressColors do not work

working example animationStep: 1

const weight = 130;
const percent = (weight * 100) / 130;

circliful.newCircle({
  percent,
  id: 'circle9',
  type: 'simple',
  backgroundCircleWidth: 10,
  foregroundCircleWidth: 11,
  strokeLinecap: 'round',
  animationStep: 1,
  noPercentageSign: true,
  text: `${weight} / 130g`,
  textReplacesPercentage: true,
  progressColors: [
    { percent: 1, color: 'orange' },
    { percent: 100, color: 'green' },
  ],
});

result
image

if I want a faster animation (animationStep: 2), the progress color never gets to green

circliful.newCircle({
  percent,
  id: 'circle9',
  type: 'simple',
  backgroundCircleWidth: 10,
  foregroundCircleWidth: 11,
  strokeLinecap: 'round',
  animationStep: 2,
  noPercentageSign: true,
  text: `${weight} / 130g`,
  textReplacesPercentage: true,
  progressColors: [
    { percent: 1, color: 'orange' },
    { percent: 100, color: 'green' },
  ],
});

result:
image

I have the code in stackblitz but this link despite having the code, does not render the chart (even tho for me it does)
https://stackblitz.com/edit/js-xgfsfk?file=index.js

Thanks for having a look!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions