naikus / svg-gauge

Minimalistic, animated SVG gauge. Zero dependencies
MIT License
319 stars 74 forks source link

Changing the direction of animation #67

Closed KPChow closed 1 year ago

KPChow commented 1 year ago

Hiya!

Just wanted to ask if there is, or will be, an option to change the direction of the gauge animating from anti-clockwise to clockwise.

Thanks.

KPChow commented 1 year ago

Never mind, I figured it out. 😂

naikus commented 1 year ago

How did you do it? Did you invert the colors for dial background and foreground?

KPChow commented 1 year ago

@naikus simply not give your gauge a value, just set the min and max.

Example:

Gauge( gauges[i], { min: 0, max: 100, dialStartAngle: 270, dialEndAngle: 269, showValue: false } ).setValueAnimated(value, 1);

naikus commented 1 year ago

Cool!