12-27-2020 12:55
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

12-27-2020 12:55
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Hello, I recently start to making watch faces with fitbitStudio and some important programming rules I don't know yet, so I decided to ask the community.
index.js code:
let floorsValue = (userActivity.today.adjusted["elevationGain"] || 0);
txtFloors.text = floorsValue;
Elevation = ((floorsValue * 167)/8000);
index.gui code:
<circle cx="30" cy="202-Elevation" r="7" fill="#444444"/>
I would like move this circumference only on the y axis as a function of the Elevation value. How can I do it?
Thanks for your attention
Answered! Go to the Best Answer.

- Labels:
-
JavaScript
Accepted Solutions
12-27-2020 13:20
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


12-27-2020 13:20
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

12-27-2020 13:05
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


12-27-2020 13:05
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Get a reference to the element object in .js, typically using getElementById. Then manipulate the equivalent property in js; something like myCircle.cy=202-Elevation
Gondwana Software

12-27-2020 13:15
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

12-27-2020 13:15
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
let Elevation= document.getElementById("Elevation");
let floorsValue = (userActivity.today.adjusted["elevationGain"] || 0);
txtFloors.text = floorsValue;
Elevation = ((floorsValue * 167)/8000);
<circle cx="30" myCircle.cy = "202-Elevation" r="7" fill="#444444"/>
In this way?

12-27-2020 13:20
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


12-27-2020 13:41
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

12-27-2020 13:41
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I managed to do the variable pass, but send me this error: Error 22 Invalid length value 'myCircle'. It is possible becouse is a number with a comma ?

12-27-2020 13:52
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

12-27-2020 13:52
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
I have done it!! thank you
12-27-2020 14:08
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


12-27-2020 14:08
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Well done! 🙂
Gondwana Software

