javascript - HighCharts - Show categories in x axis intead of the value of x in Bubble Chart -


i've got bubble chart simple, want it's show in xaxis custom string instead of x value. fist object in serie in x axis show proyect 1 , on.

$(function () { var names = ["dave","john"]; var projects = ["project 1","project 2"]; $('#container').highcharts({      chart: {         type: 'bubble',         plotborderwidth: 1,         zoomtype: 'xy'     },      title: {         text: 'highcharts staff project time'     },      xaxis: {         categories:['project 1', 'project 2', 'project 3']     },        series: [{         data: [                    { x: 3.5, y: 4, z: 5, color: 'blue' },                    {  x: 7, y: 7, z: 3, color: 'blue' },                    {  x: 4, y: 8, z: 6, color: 'blue' }                 ],     }]    }); }); 

we want show project 1, proyect 2.... instead of corresponding x value. maybe in x axis shows there xaxis: { categories:['project 1', 'project 2', 'project 3'] },

or in object example

data: [ { name: proyect 1, x: 3.5, y: 4, z: 5, color: 'blue' }, { name: proyect 2, x: 7, y: 7, z: 3, color: 'blue' }, { name: proyect 3, x: 4, y: 8, z: 6, color: 'blue' } ],

and show in x axis name instead x value.

here's jsfiddle been using test replacing data data.

http://jsfiddle.net/jlbriggs/36zn2/1/

we've got bubble chart simple, want it's show in xaxis custom string instead of x value

$(function () { var names = ["dave","john"]; var projects = ["project 1","project 2"]; $('#container').highcharts({      chart: {         type: 'bubble',         plotborderwidth: 1,         zoomtype: 'xy'     },      title: {         text: 'highcharts staff project time'     },      xaxis: {         categories:['project 1', 'project 2', 'project 3']     },        series: [{         data: [                    { x: 3.5, y: 4, z: 5, color: 'blue' },                    {  x: 7, y: 7, z: 3, color: 'blue' },                    {  x: 4, y: 8, z: 6, color: 'blue' }                 ],     }]     }); }); 

we want show project 1, proyect 2.... instead of corresponding x value. maybe in x axis shows there

 xaxis: {         categories:['project 1', 'project 2', 'project 3']       }, 

or in object example

data: [                    { name: proyect 1, x: 3.5, y: 4, z: 5, color: 'blue' },                    { name: proyect 2, x: 7, y: 7, z: 3, color: 'blue' },                    { name: proyect 3, x: 4, y: 8, z: 6, color: 'blue' }                 ], 

and show in x axis name instead x value.

i answer highcharts helpdesk , want share it:

in first scenario, labels categories not printed, because categories indexed 0, have labels "until 2" index. in data refer 3,5 / 4 / 7 index, numbers printed. (labels these index don't exist in categories).

you can use solutions that: - fix index in data, here: http://jsfiddle.net/ee5ffq9w/1/ - increase amount of categories - use points category name: http://jsfiddle.net/ee5ffq9w/2/


Comments