【发布时间】:2016-09-22 12:51:42
【问题描述】:
我正在使用 highcharts.js 构建条形图。我不知道如何删除 x 轴标签?我知道我必须更改 xAxis 对象,但我已经尝试了以下所有选项,但没有任何对我有用。我知道这是可能的,但我错过了一些东西。任何帮助是极大的赞赏。这是我从fiddle开始的情节的小提琴。
xAxis: {
categories: [''],
title: {
text: null
},
labels: {
enabled:false
}
}
xAxis: {
labels: {
enabled:false
}
}
数据对象,只有一个样本大小..
var obj = {
"data": [0.397851,1721745],
"color":'rgb(51, 204, 51)',
"organism_labels":"klebsiella_oxytoca"
},{
"data": [0.609935,66529],
"color":'rgb(51, 204, 51)',
"organism_labels":"staphylococcus_aureus"
},{
"data": [0.505084,45563],
"color":'rgb(51, 204, 51)',
"organism_labels":"legionella_longbeachae"
},{
"data": [0.669884,83471],
"color":'rgba(223, 83, 83, .5)',
"organism_labels":"enterobacter_aerogenes"
}, {
"data": [0.688673,1309077],
"color":'rgba(223, 83, 83, .5)',
"organism_labels":"pseudomonas_aeruginosa"
}
HighCharts.js
/** Histogram **/
$(function () {
$('#histogram').highcharts({
chart: {
type: 'column',
zoomType: 'xy'
},
title: {
text: 'Histogram'
},
subtitle: {
text: 'Please Help!'
},
xAxis: {
min:0,
max:1,
minPadding: 0,
maxPadding: 0
},
yAxis: {
title: {
text: 'Reads'
}
},
credits: {
enabled: false
},
series:
obj
});
});
当前剧情:
【问题讨论】:
-
你有你的图表的现场演示吗?因为 xAxis:{labels:{enabled:false}} 应该可以工作。 jsfiddle.net/12e95k8s
标签: plot highcharts labels axis-labels