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

Need help - problem with elevationGoal and caloriesGoal data

Replies are disabled for this topic. Start a new one or visit our Help Center.

Hello,

I wonder if someone can help me or confirm that there is a reported bug here. But it seems that I can not get correct goal data from "elevationGoal" and "caloriesGoal".FitbitAs you can see, I am getting different values for "Progress Arcs" for both. Code is as below...

const elevationGoal = userActivity.goals.elevationGain;

and then..

  const metricElevation = "elevationGain";
  const amountElevation = userActivity.today.adjusted[metricElevation] || 0;

and finally...

  dailystairs.innerText = amountElevation;
  let elevationAngle = Math.floor(360*(amountElevation/elevationGoal));
  if ( elevationAngle > 360 ) {
    elevationAngle = 360;
    elevationRing.fill="#58e078";
  }
  elevationRing.sweepAngle = elevationAngle;

Similar code for Calories as well.. Any help is greatly appreciated.

 

Best Answer
0 Votes
2 REPLIES 2

Fitbit.jpg

 

 

Best Answer
0 Votes

Apologies...wrong forum.

Best Answer
0 Votes