I have this function:
var chart = d3.parsets()
.dimensions(["Survived", "Age", "Class"]);
I want to replace ["Survived", "Age", "Class"] with a string from an other variable. So i can change it. In this example: .dimensions(["Survived", "Age"]);
What i have is:
var strDimensions = ('"Survived", "Age"');
var chart = d3.parsets()
.dimensions([strDimensions]);
but that doesn’t work
What you are getting is an array with one index, not two.
If you want to use the string, you can split it to make it into an array.
Why don’t you just start off with the array to begin with?