Copy link to clipboard
Copied
Hi, I would like to scale a layer from its axis say from 0 to 100 using numerical text such as 0 - 100.
Basically automate a bar graph values by setting the anchor at the bottom or rectangles and having some text on top links to nulls from paths, so when I wrote 20 in the text on top it would scale the rectangle to 20% scale and move the nulls up. but I also wanted to add the % after the text with +'%' but not sure how I can do that.
All I can manage so far is to use
comp('master').layer([index]).text.sourceText+'%'
which uses the text from 'master' comp and adds the % but id also like to use that value to control the scale of a rectangle in the comp as well, the rectangle is not in the master comp layer.
Any ideas? I dont mind it all being controlled from the same comp if its easier.
Thanks]
Mac
Copy link to clipboard
Copied
Something like this should work, as long as the scale value is the first part of the text:
y = parseFloat(comp('master').layer([index]).text.sourceText);
[value[0],y]
Copy link to clipboard
Copied
This worked perfectly, Thank you so much!
Copy link to clipboard
Copied