Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Is there an expression that uses numeric data to define minimum and maxim values for a bar chart?

New Here ,
Jul 03, 2023 Jul 03, 2023

I am an IT Analyst for Ralph Lauren but I am developing InfoGraphic presentations on a monthly basis reflecting our world wide IT activities for our corporate office. My immediate difficulty involves creating over a dozen bar graphs that use numeric values instead of percentages.
(1) Is there an expression that would help with this task?
(2) How would I define the minimum and maximum values for each graph?
(3) How would I have animate the bar to the desired position?
(4) How can I use a slider to make this whole process easier?

 

I would appreciate any suggestions on the most efficiently way to produce (create/update) these reoccuring graphs for our monthly corporate presentations. Each presentations includes 30+ graphs of varying types (pie, bar, x-y/scatter). Each month, the graphs are the same, just diffrent data changes. Once I have a good working model of each type of graph, I could just change the data values - seems simple right?

But alas, this would only work if  all the graphs were calculated using percentage valuse. As I explained earlier After Effects native parameters seem to use only percentage values, yet 27 of the 35 graphs I produce use specific numeric data values. I have viewed dozens of InfoGraphic templates from Envato, but they seem to also calculate their values as percentages not actual number values. Additionally most of the InfoGraphic templates I have seen, seem to only only permit comparing a maximum of 10 different objects nd I need at least 16. 

TOPICS
Expressions , How to , Scripting
249
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 03, 2023 Jul 03, 2023

The easiest approach is to set up a linear method based on a slider value or the x or y size or position value of another layer or shape layer. If you have a graph that needs a Y axis with values between 40 and 500, and a slider named Value that you can animate between 40 and 500, something like this would give you a Rectangle 1 shape that would change from 10 pixels minimum to 900 pixels high when the slider is moved between 40 and 200. 

x = 100;
t = thisComp.layer("Controls").effect("Value").slider;
y = linear(t, 40, 200, 10, 900);
[x, y]

//AND THIS FOR layer/Contents/Rectangle 1/Tranform Rectangle 1/Anchor Point;
ofst = content("Rectangle 1").content("Rectangle Path 1").size[1] / 2;
[0, ofst]

You will jsut have to put in the ratios you want. I hope this gets you started. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 06, 2023 Jul 06, 2023
LATEST

Fabulous, I used this and it has worked perfectly! Many thanks to you for taking the time to reply.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines