在高图表Y轴中,我想显示一些分数值,如100 / 50,100 / 70 100/90
有可能吗?请帮助我如何展示价值观。
$.getJSON('1.php?ID=' + <?php echo $Id; ?>, function(json) {
$('#container').highcharts({
chart: {
renderTo: 'container',
type: 'spline',
animation: Highcharts.svg,
marginRight: 130,
marginBottom: 25,
},
title: {
text: 'Lab',
x: -20 //center
},
subtitle: {
text: '',
x: -20
},
xAxis: {
type: 'time',
tickPixelInterval: 007
},
yAxis: {
title: {
text: 'Lab'
},
plotLines: [{
value: 0,
width: 1,
color: '#808080'
}]
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'top',
x: -10,
y: 100,
borderWidth: 0
},
exporting: {
enabled: true
},
series: [{
name: 'Lab',
data: json.data,
datataLabels: {
enabled: true,
rotation: -90,
color: '#FFFFFF',
align: 'right',
y: 10,
style: {
fontSize: '13px',
fontFamily: 'Verdana, sans-serif',
textShadow: '0 0 3px black',
}
}
}]
});
});
&#13;
1.php只有MySQL重试查询 $ sth = mysql_query(&#34; SELECT DateandTime,BP FROM table WHERE ID =&#39;&#34;。$ Id。&#34;&#39;&#34;);
答案 0 :(得分:1)
你应该能够通过做下面列出的一些事情来完成我相信你表明你想要的东西。
首先,您需要重新构建JSON数据包以包含Highcharts可以在一系列中使用的标签,如下所示:
var json = {
data: [ ["100/50",(100/50)], ["100/60",(100/60)], ["100/75",(100/75)], ["100/30",(100/30)] ]
};
然后你需要对你的图表js进行一些调整,这样你就可以通过在highcharts配置对象中添加这个块来覆盖默认的工具提示(在xAxis块之后是一个很好的位置):
xAxis: {
//some xAxis overrides here
},
tooltip: {
pointFormat: ''
},
这样做基本上是告诉highcharts使工具提示数据指向&#39;&#39;,所以实质上它不会被渲染,但标签仍会显示在你的鼠标悬停上。
完成后,您的yAxis标签仍然是十进制值,表示分数的范围步长,因此您要么要抑制它,要么另外处理它。