drawArc array

How can i do a simple drawArc with array i tried this but it does not work

w = avgPower*180/y;
for (var i = 0; i < w; i += (180/18)){
dc.drawArc(x/2, y/2,x/2-10,1,270-i,(270-w/18-1));

  • Are you trying to specifically draw 10 arcs, or do you just want to draw an arc that could go from 6 o'clock, clockwise to 12 o'clock (270 to 90 degrees in garmin speak) based on where your average power is sitting?

    for me, i do this - to draw an arc from 6 o'clock, clockwise for up to 180 degrees:

    set a variable (perc) which is a percentage of where your average power sits within some range - I use a percentage (decimal between 0 and 1) of whatever power zone it's sitting in.

    On a fenix 5+ with a 240X240 screen, I've used: x=120, y=120, r=115 ( depending on the width of the line you use to draw the arc)

    dc.drawarc(x, y, r, Gfx.ARC_CLOCKWISE, 270, 270 - (180 * perc))

    It's all about setting the starting position, the length of the arc (in degrees) and the direction to draw - CIQ takes care of the rest.  no need to do this in a loop - unless that's what you're specifically trying to do?

  • thans a lot, is there a sample of how to make a simple wacth??