I am trying to dynamically add categories to JavaScript object from a string. But the problem is that commas inside this string are not recognized as separate items.
So I have this:
var prices = json_graph['offer_prices'].join(','); // that returns for example '2,3,4,5'
Then I want to use this like so:
xAxis: {
categories: [prices]
}
The problem is, that this is recognized as a single item. How can I split this string by commas and add it under categories?
Thanks for your help!