我正在将Highcharts用于带有mysql记录集的项目。 我有两件事我找不到解决方案:
这是我的代码:
var SpectrumName = '<?php echo $SpectrumName; ?>';
var SpectrumDate = '<?php echo $SpectrumDate; ?>';
var chart;
$(document).ready(function() {
chart = new Highcharts.Chart({
size:[ 400,250 ],
chart: {
renderTo: 'container',
zoomType: 'xy',
defaultSeriesType: 'line',
marginRight: 130,
marginBottom: 50,
},
title: {
text: 'AstroSpec Observation of: ' + SpectrumName,
x: -20 //center
},
subtitle: {
text: 'Acquired on: ' + SpectrumDate,
x: -20
},
xAxis: {
categories: [<?php echo $x_colf1; ?>],
labels: {
formatter: function() {
if (this.index % 500) { // even numbers only
return this.value;
} else {
return false;
}
}
}
},
yAxis: {min: 0,
title: {
text: ''
},
plotLines: [{
value: 30,
width: 3,
color: '#808080'
}]
},
plotOptions: {
series: {
enableMouseTracking: false,
marker: {
enabled: false
}
}
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'top',
x: -10,
y: 100,
borderWidth: 0
},
series: [{
name: 'R',
data: [<?php echo $y_axis; ?>]
}]
});
});
答案 0 :(得分:2)
对于#1,请尝试按以下方式设置min
和tickInterval
:
xAxis: {
min: 3000,
tickInterval: 500
}
我没有完全满足要求#2。