So I've got some state that is an object which looks like this
object:{
foo: Array[3]
bar: Array[6]
}
And The amount of entries inside the object may change, it could have 3 arrays, it could have 10. It needs to be dynamic I've got to display those as counts (in a pie chart) which accepts the data to look like this, with data being the prop inside the JSX tag
data:{[
{x:foo, y:foo.length},
{x:bar, y:bar.length}
]}
x outputs as the name and y outputs as the number (not a percent, the lib works it out for me)
I've tried using some examples on here such as this thread but I'm just not getting it
Preference for ES6 syntax & I'm using Victory for my graphing lib if you're interested