Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SVG - Arc

ANSWERED

How can i change sweep-angle on runtime?


GUI:

<arc id="steps" x="30" y="20" width="100" height="100" fill="fb-lime"
arc-width="10" start-angle="0" sweep-angle="90" />

 

JS:

var arcSteps = document.getElementById("steps");

arcSteps.sweep-angle = "120"; <--- it doesnt work, build failed

arcSteps.sweepAngle = "120"; <--- it has no impact

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

Some of our SVG are lacking in this release. sweepAngle should be in the next update though!

View best answer in original post

Best Answer
0 Votes
11 REPLIES 11

Some of our SVG are lacking in this release. sweepAngle should be in the next update though!

Best Answer
0 Votes

Will start-angle be in it as well? I am going through the same issue.

 

Ps how do you guys do the circles in the watch faces without this function? Do you have an alternative idea/coding you are using?

Best Answer
0 Votes

Sorry for the bump, but this is something Im working on as well. Wondering how this is currently implemented in the gauges clock face. 

Best Answer
0 Votes

when is the next release that would have start-angle & sweep-angle that can be changed during run-time?

Best Answer
0 Votes

xxxxx.sweepAngle started working for me.

I am not sure if there have been changes, but it does work now.

 

Best Answer
0 Votes
What function did you call to change the start angle and or sweep angle? 

Also, when setting SVG style values from within JavaScript, how do I tell it 100% (or any percent actually)?

Thx!
Chuck
Best Answer
0 Votes

My code for sweepAngle is basically:

 

import document from "document";

let tideArc = document.getElementById("tideArc");

function processTideData(data) {

  var time = data[1].date;
  var epoch = data[1].dt;
  var orario = new Date(epoch * 1000);
  let now = Date.now();
  var timeDiff = Math.round((orario-now)/120000);
  
  tideArc.sweepAngle = Math.abs(180-timeDiff)
  
  }
Best Answer

I can confirm this is also working for me. Quite exciting.

Best Answer
0 Votes

Did you every figure out how to set a start angle?

Best Answer
0 Votes

Hi, 

Did you ever get this solved? I am experiencing the same issue. 

 

Thanks.

Best Answer
0 Votes

NVM. I had a conflicting script in my code! thanks.

Best Answer
0 Votes