HI all,

I´m playing around with the hypeDocument.cloneElement - extension. Works pretty fine for me, I can adress the clones, give them class names, change color etc. ... just one issue:

given:

- an area represented by a square and a single bar (cloneOriginal)

my objective:

- clone the bar n-times and distribute cloneOriginal in between the area evenly (as you see, it´s gonna be a bar chart... )

Distribution is done by calculating the gap between the bars.

... and it works NEARLY perfectly. But the distribution is not ABSOLUTELY exact. I guess, it´s a math calculating thing, since the gaps differ slightly in width...

Distribution is correct, if I use Math.round or Math.floor for calculating the gap, but then the bars don´t fit inside the area...

Any idea?

Best regards, Kalle

Distribution without using Math.floo or Math.round

Distribution using Math.floo or Math.round

cloneDistribute.zip (46.5 KB)