highchart 横轴纵轴数据

1、highchart 横轴为字符串数组,必须加引号;纵轴为数值数组,不能加引号
2、series中的json内容,属性不能加引号
3、chart.height: Number,图表的高度。默认高度是根据容器 div 的高度值计算而来,如果容器没有设置高度值,则是 400px。

4、横轴可以直接通过数组进行赋值,如下doorArr;或foodOptions.xAxis.categories = doorArr;
 xAxis: {
            categories: doorArr,
            title: { text: null }
        },

纵轴foodOptions.series[0].data = totalArr;或在option中按照json格式赋值

{chart: {renderTo: 'container',animation: false,type: 'column'}, title: {text:' 销售数据明细'},
xAxis: {categories: [‘熟食','包子','汇总'],title: { text: null }},yAxis: {min: 0,title: {text: '销售额 (元)',align: 'high' },
labels: {overflow: 'justify'}}, credits: {enabled: false},
 plotOptions: {
 column: {dataLabels: { enabled: true}},
 events: {click: function(e) { alert(e.point.category); }}},
 
 series: [{cursor: 'pointer',show: true,animation: true,name: '销售额', dataLabels: {enabled: true },  data: [63.4000,480.0000,543.4]}]});
        });

posted @ 2016-02-22 11:26  mebius  阅读(462)  评论(0编辑  收藏  举报