Line/bar chart reference external #?

Hey friends, i’m trying to plot some numbers that i’m getting via api. The catch is that the structure is such that each data point comes with a list of numbers and i want to plot the nth of each list.

So for example the 2nd number of each list needs to be plotted etc

I’d like to stick all the graphs in an RG & just call "this list of numbers :item #:current cell’s index… but i can’t reference any outside numbers.

Anyone have a creative idea how to work around this?

To be clear, you want to make a list of n’s using each item n from each array provided? maybe this can help you get started. i would use a simple js solution for this

 var arrays = [
[1,2,3],
[4,5,6],
[7,8,9]
]

function getarray(apple){
let newarray=[]
let index = 
arrays.forEach( (elm) => {
newarray.push(elm[apple])
})
return newarray
}
console.log(getarray(1))
1 Like

sorry, i didn’t explain it very well haha. I’ll give it another go:

i have arrays like this:

1,4,6,12,26,1

2,5,1,23,54,0

6,1,5,23,61,2

the first number of each array is a corresponding type, second… etc.

ah, you understood. How do i feed that into the chart though? I assume that just leaves me with a list of numbers… which the line/bar chart element won’t accept

var arrays = [
[1,2,3],
[4,5,6],
[7,8,9]
]

function getarray(apple){
let newarray=[]
let index = 
arrays.forEach( (elm) => {
newarray.push(elm[apple])
})
return newarray
}

arrays.forEach( (elm,index) =>{
console.log(getarray(index))
})

you should be able to output this with a javascript element. I would build this out as a plugin if i was you.

i could likely build one out for a small fee. otherwise Im hoping this gets you started!

1 Like

thanks for the help! I’ll build it out :slightly_smiling_face:

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.