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

Can't get CycleView working properly

I have a simple watchface which I'm wanting to include Cycleview on so that I can allow the user to cycle through some stats.  I've used the info on this page:

 

https://dev.fitbit.com/build/guides/user-interface/svg-components/views/

 

To setup the watchface in Fibit Studio but the stats are static and do not change.  Obviously theres a step missing ?

 

Can anyone point to a solution to get 'live' cycle view stats please.  I"m after

HR

Steps

Stairs

Distance

 

etc

Best Answer
0 Votes
2 REPLIES 2

That examples page spends a lot of space on the SVG elements. Did you catch this part in the index.js?

items.forEach((element, index) => {
  let touch = element.getElementById("touch");
  touch.onclick = function(evt) {
    console.log(`touched: ${index}`);
  };

 

That's what actually triggers the changes.

Best Answer
0 Votes

Hi 

Thanks for your reply.  I'm still puzzled as to where to put that 

 

items.forEach((element, index) => {
  let touch = element.getElementById("touch");
  touch.onclick = function(evt) {
    console.log(`touched: ${index}`);
  }; 

 

I"ve tried pasting it into the index.js but then the build fails.

 

Best Answer
0 Votes