highcharts API有两个connectNulls
属性的示例:一个用于true
,另一个用于false
。
http://api.highcharts.com/highcharts#series.connectNulls
的true
例如:http://jsfiddle.net/gh/get/jquery/1.7.1/highslide-software/highcharts.com/tree/master/samples/highcharts/plotoptions/series-connectnulls-true/
从true
示例的片断:
plotOptions: {
series: {
connectNulls: true
}
},
的false
例如:http://jsfiddle.net/gh/get/jquery/1.7.1/highslide-software/highcharts.com/tree/master/samples/highcharts/plotoptions/series-connectnulls-false/
从false
电子一个片段xample:
plotOptions: {
series: {
// connectNulls: false // by default
}
},
的false
默认值是一个深思熟虑的选择,因为当你连接值时,没有数据,其结果可能导致对图表的观众的部分错误的假设。
UPDATE
这里有一个Highstock例如:
$(function() {
window.chart = new Highcharts.StockChart({
chart : {
renderTo : 'container'
},
rangeSelector : {
selected : 1
},
title : {
text : 'AAPL Stock Price'
},
series : [{
name : 'AAPL',
connectNulls: true,
data : [
[1112832000000,43.56],
[1112918400000,43.74],
[1113177600000,41.92],
[1113264000000,null],
[1113350400000,null],
[1113436800000,37.26],
[1113523200000,35.35],
[1113782400000,35.62],
[1113868800000,37.09],
[1113955200000,35.51],
[1114041600000,37.18],
[1114128000000,35.50],
[1114387200000,36.98],
[1114473600000,36.19],
[1114560000000,35.95],
[1114646400000,35.54],
[1114732800000,36.06]
],
tooltip: {
valueDecimals: 2
}
}]
});
});
奇怪,我提供没有例子的链接,但你一样。看起来像highstock和highchart文档是不同的。 – unexplored 2012-04-05 13:10:25
@unexplored - 添加了HighSTOCK示例。 – mg1075 2012-04-05 14:27:27
所有链接现已停止。 – MightyPork 2014-08-06 18:02:00