Axis with array values, highcharts

I have in my script:

var categoria = new Array();
        for (var i=0;i<3;++i)
        {
               (function(j) {
                         categoria[j] = "data number"+j;
                         return j;
               })(i);
        }
$(".pastel").highcharts({
.
.
.
xAxis: {
       categories[categoria]
       },
.
.
.
});

if I exported with CSV plugin shows me this:

(shows data improperly using array "categoria")

Using array in xAxis

aXis format should be as follows(correctly):

$(".pastel").highcharts({
.
.
.
xAxis: {
       categories["data number 0","data number 1","data number 2"] /* with the array "categoria" is expected to get this format, the correct way. */
       },
.
.
.
});

if I exported with CSV plugin shows me this:

(shows data appropriately, I need to do this but with the array "categoria")

enter image description here

How I can do to make the array using "categoria" displays data as in the image 2? is there any way to do this?

Upvotes: 0

Views: 188

Answers (1)

Radek Michna
Radek Michna

Reputation: 509

this should work

.
xAxis: {
   categories:categoria
   },
.
.

Upvotes: 1

Related Questions