Skip to content

Commit

Permalink
redeclare local variable
Browse files Browse the repository at this point in the history
  • Loading branch information
jackyuan1 committed Nov 29, 2023
1 parent d328cc4 commit e8fe459
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions assets/js/2FA.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ let Piechart = function(options){
}

start_angle = 0;
for (categ in this.options.data){
val = this.options.data[categ];
slice_angle = 2 * Math.PI * val / total_value;
for (const categ in this.options.data){
const val = this.options.data[categ];
const slice_angle = 2 * Math.PI * val / total_value;
let pieRadius = Math.min(this.canvas.width/2,this.canvas.height/2);
let labelX = this.canvas.width/2 + (pieRadius / 2) * Math.cos(start_angle + slice_angle/2);
let labelY = this.canvas.height/2 + (pieRadius / 2) * Math.sin(start_angle + slice_angle/2);
Expand Down

0 comments on commit e8fe459

Please sign in to comment.