react-gauge-chart icon indicating copy to clipboard operation
react-gauge-chart copied to clipboard

Needle shows current value before animating to it from 0

Open rlaunch opened this issue 2 years ago • 2 comments

Hello,

I've got a gauge chart setup like this:

const chartStyle = {
      height: 112.5,
}

return <div style={{width: "250px"}}>
        <GaugeChart
            style={chartStyle}
            nrOfLevels={3}
            arcsLength={arcLengths}
            colors={colours}
            hideText={true}
            percent={gaugePerc}
            arcPadding={0.05}
            cornerRadius={1}
        />
</div>

The value changes from 0, to another value for example 0.7 after an API call returns some data. I'm seeing an issue where when the gauge changes to another value, the chart does not animate to it at first (it just jumps straight there), before then animating from 0 to it.

See GIF of the issue

rlaunch avatar Nov 02 '22 10:11 rlaunch

@rlaunch I had this same issue and setting animDelay to 0 solved it. Not ideal but worked for my use case so figured I'd share.

chambaz avatar Nov 09 '22 00:11 chambaz

Hi @chambaz.

Thanks for sending that, it's sorted the issue for me

rlaunch avatar Dec 22 '22 14:12 rlaunch