Hey Leonie, here are some thoughts based on your files:
1. If I understood correctly, your initial ideal will won’t work with dynamic number of data points, UNLESS you make sure there are that much layers created in the “Graph” comp. Meaning, if you do it now with more than 12 values – it won’t work (I guess you are aware of this, but just to highlight an issue of this approach)
2. In “Graph” comp, assuming your comp structure isn’t going to change, define seriesrating[X] as seriesrating[index+1] (as first layer in a list starts with index of 1, but arrays has indexing from 0). You won’t need to manually update it.
3. Now with above in mind, you should add a check which evaluates maximum seriesrating index in a .json, to not overcome maximum. This could be done in a control layer at the bottom of the comp, on in other place. Since you are approaching this Seasons-based, I would suggest collecting objects in array, which has matching “Season” index. Then – getting length of that objects array.
4. When number of season-items will be clear, you can interpolate X’s distances based on that number, and your comp/design width. However, 1st point must be taken into account for this.
5. I would suggest to not have contants attached to variables like “-600” and “900” – link them through Sliders, to have dynamically adjustable design.
Hope any of these helps to figure it out!
Social Media Profiles