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

Fluid meter does not update #2

Open
Zzo911 opened this issue Apr 16, 2023 · 0 comments
Open

Fluid meter does not update #2

Zzo911 opened this issue Apr 16, 2023 · 0 comments

Comments

@Zzo911
Copy link

Zzo911 commented Apr 16, 2023

Hello,

I'm trying to migrate from the old script to this one (using bundle.js) but the meter is not updating.

In my HTML I have created the DIV.
<div id="water_level0" class="meter-container"></div>

Then in a JS I created the fluid meter.
const water_level0 = document.querySelector("#water_level0");
new cfmModule.CircularFluidMeter(water_level0, {
borderWidth: 20,
initialProgress: 0,
maxProgress: 100,
backgroundColor: '#e2e2e2',
borderColor: '#f8f9fa',
bubbleColor: '#6bcfff',
dropShadow: false,
use3D: true,
fontSize: 50,
progressFormatter: (value) => {
return ${value.toFixed(0)}%;
},
fluidConfiguration: {
color: '#16e1ff'
}
});

And finaly I update the progress value reading a JSON, but it's not working, the meter stays to zero.
water_level0.progress = myJSON.water_level0;

With the old script I used this and it was working.
water_level0.setPercentage(myJSON.water_level0);

What am I doing wrong?

Many thanks for your support

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