ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Expression for dynamic number values (on a bar chart)

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Barnabas Horvath
Expression for dynamic number values (on a bar chart)
on Mar 9, 2019 at 4:52:24 pm

Hello!

I'm trying to create a bar chart with dynamic bars and numbers. I've found tutorials for these charts with %s connected to the size of a bar (with slider controls and basic math.round expressions), so that I can do.

My problem is that I'd like the chart to display dollar values. Is it possible to do that? What I'd like to achieve is that the slider control controls the size of the chart (between a 0-100 scale, that's perfectly fine), while the same slider controls the the $ values too. (So when the chart is at 100% the number says $1500, but when it's at 50% it says $750.)

Is it possible to create a math expression like that for the text layer?


Return to posts index

Dan Ebberts
Re: Expression for dynamic number values (on a bar chart)
on Mar 9, 2019 at 6:17:23 pm

Something like this maybe:

s = thisComp.layer("control").effect("Slider Control")("Slider").value;
maxVal = 1500;
"$" + Math.round((s/100)*maxVal)


Dan



Return to posts index

Avinash Sure
Re: Expression for dynamic number values (on a bar chart)
on Mar 10, 2019 at 10:07:04 am

Hi Dan , I have a similar problem i checked you video on YouTube regarding Animate Data-Driven Graphics in After Effects (https://www.youtube.com/watch?v=JPiyOGyjWvI)

I have tried to change the expression to my needs i.e i need to create a bar graph similar to this one in the video



. but i have failed miserably


could you please give me an idea how to proceed with this please. i am trying to create a animated bar graph which shows the military expenditure of countries from 1990 to 2030 , i want the x axis to change based on the value and the position of the rectangle should also change based on its rank.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2019 CreativeCOW.net All Rights Reserved
[TOP]