Multiple gauge Problem #72

Closed
Sharagim opened this Issue May 20, 2015 · 11 comments

Projects

None yet

4 participants

@Sharagim

Hi,
When using multiple instance of the gauge, all pointers have been overwritten by last pointer setting.
https://jsfiddle.net/d1ygogps/5/

@sohandsouza

I believe I am encountering the same problem. If I change the color of one gauge's pointer, the color of the other one's pointer changes too, even though they are set with different option objects.

@jonkpirateboy

I have the same problem.

@HunterJoe

Updated your fiddle to use the correct instance of the gage in the first gauge's set method.
https://jsfiddle.net/HunterJoe/25tn1zw3/

Also your max value on the first gauge was 0.

@Sharagim
Sharagim commented Aug 8, 2015

Thx for reply.
I put "gauge1.set(1260);" again and you can see what is happening.
Please see:
https://jsfiddle.net/30ujm879/

@HunterJoe

ok, so your latest fiddle does indeed work, and it is doing exactly what you are telling it to do.

You have gauge1.set(10) at the very bottom of your fiddle (line 44). Remove that, and it will "gauge" to the value set earlier of 1100, on line 20.

@Sharagim
Sharagim commented Aug 8, 2015

So how we can change values on fly? I have a ajax job which read values and I want to update them.

@HunterJoe

I do not believe there is a way to update the value in the fly. I do not think this script works that way, nor was meant to work that way.

I am sure it can be achieved, but it would not be a simple process. I'll try to work out a fiddle for you.

@Sharagim
Sharagim commented Aug 8, 2015

Thx for your reply.
Currently I am doing it in this way:
I put the OBJECT to a jquery data and each 5 sec a script will update each gauge according to last value. The only problem is this problem which you can see.

@sohandsouza

Hi, HunterJoe.

The pointer color setting for a single gauge is still overwriting pointers across all gauges. Am I setting it wrong?
https://jsfiddle.net/qjmdwcfy/

@HunterJoe

No it looks like you are doing it right, this actually looks to be a bug in the core plugin.

Having multiple instances of the gauge does not allow for individual pointer colors, it instead picks up the settings from the last gauge instance. I would report this as a bug.

gauge1 pointer should be red.
gauge2 pointer should be blue.
Both are blue.
https://jsfiddle.net/HunterJoe/25tn1zw3/2/

@sohandsouza

Wow, then it happens even if the pointer color is set in the initial declaration of the options.

@kplindegaard kplindegaard added a commit to kplindegaard/gauge.js that referenced this issue Feb 4, 2017
@kplindegaard kplindegaard Fixed #72: Fixed a bug causing all gauge pointers to have the same co…
…lor.
329eaca
@kplindegaard kplindegaard added a commit that referenced this issue Feb 4, 2017
@kplindegaard kplindegaard Fixed pointer color problem (issue #72) (#113)
Fixed #72: Fixed a bug causing all gauge pointers to have the same color.
0370e88
@kplindegaard kplindegaard added a commit that closed this issue Feb 4, 2017
@kplindegaard kplindegaard Fixed pointer color problem (issue #72) (#113)
Fixed #72: Fixed a bug causing all gauge pointers to have the same color.
0370e88
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment