Highcharts 高图表X轴值与系列数据无关
我有以下几个问题 使用highcharts,我想显示x轴标签0.0001,0.001,0.01,0.1,1,10100的系列。但并没有向它展示一些方法 如何强制显示所有x轴值Highcharts 高图表X轴值与系列数据无关,highcharts,Highcharts,我有以下几个问题 使用highcharts,我想显示x轴标签0.0001,0.001,0.01,0.1,1,10100的系列。但并没有向它展示一些方法 如何强制显示所有x轴值 请帮助。我想您遗漏了一些东西。我可以使用下面的代码用您提供的数据绘制您的聊天记录 $(function () { $('#container').highcharts({ chart: { type: 'areaspline' }, title: { text: '
请帮助。我想您遗漏了一些东西。我可以使用下面的代码用您提供的数据绘制您的聊天记录
$(function () {
$('#container').highcharts({
chart: {
type: 'areaspline'
},
title: {
text: 'Average fruit consumption during one week'
},
legend: {
layout: 'vertical',
align: 'left',
verticalAlign: 'top',
x: 150,
y: 100,
floating: true,
borderWidth: 1,
backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF'
},
xAxis: {
categories: [0.0001,0.001,0.01,0.1,1,10,100],
plotBands: [{
from: 4.5,
to: 6.5,
color: 'rgba(68, 170, 213, .2)'
}]
},
yAxis: {
title: {
text: 'Fruit units'
}
},
tooltip: {
shared: true,
valueSuffix: ' units'
},
credits: {
enabled: false
},
plotOptions: {
areaspline: {
fillOpacity: 0.5
}
},
series: [{
name: 'Tokyo',
data: [7.0, 6.9, 9.5, 14.5,0,0,0]
}, {
name: 'New York',
data: [-0.2, 0.8, 5.7, 11.3]
}, {
name: 'Berlin',
data: [-0.9, 0.6, 3.5, 8.4]
}, {
name: 'London',
data: [3.9, 4.2, 5.7, 8.5]
}]
});
})) 谢谢你@RahulSharma。在任何地方都找不到答案!!我想显示x轴的所有类别,我的代码只显示0.0001,0.001,0.01,0。1@yog2411,好的,x轴上的其他值没有显示的原因是序列上没有相应的值,在x轴上有[0.0001,0.001,0.01,0.1,1,10100],并且发送的相应数据为[-0.2,0.8,5.7,11.3],解决方案是给它传递一个任意值,比如说0,那么你会得到这样的东西[-0.2,0.8,5.7,11.3,0,0,0],这些值会显示在x轴上
$(function () {
$('#container').highcharts({
chart: {
type: 'areaspline'
},
title: {
text: 'Average fruit consumption during one week'
},
legend: {
layout: 'vertical',
align: 'left',
verticalAlign: 'top',
x: 150,
y: 100,
floating: true,
borderWidth: 1,
backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF'
},
xAxis: {
categories: [0.0001,0.001,0.01,0.1,1,10,100],
plotBands: [{
from: 4.5,
to: 6.5,
color: 'rgba(68, 170, 213, .2)'
}]
},
yAxis: {
title: {
text: 'Fruit units'
}
},
tooltip: {
shared: true,
valueSuffix: ' units'
},
credits: {
enabled: false
},
plotOptions: {
areaspline: {
fillOpacity: 0.5
}
},
series: [{
name: 'Tokyo',
data: [7.0, 6.9, 9.5, 14.5,0,0,0]
}, {
name: 'New York',
data: [-0.2, 0.8, 5.7, 11.3]
}, {
name: 'Berlin',
data: [-0.9, 0.6, 3.5, 8.4]
}, {
name: 'London',
data: [3.9, 4.2, 5.7, 8.5]
}]
});