我正在使用Highchart繪製我的數據圖表。我已經看到date range選擇器在這個圖表中,但我使用的是Area Graph,但範圍選擇器不在此。以下是我的代碼。範圍選擇器是高圖的圖表
jQuery('#weenat_statr_chart').highcharts({
title: {
text: chart_title
},
xAxis: {
type: 'datetime'
},
yAxis: {
title: {
text: null
}
},
tooltip: {
crosshairs: true,
shared: true,
valueSuffix: unit_value
},
legend: {
},
,
rangeSelector: {
buttonTheme: { // styles for the buttons
fill: 'none',
stroke: 'none',
'stroke-width': 0,
r: 8,
style: {
color: '#039',
fontWeight: 'bold'
},
states: {
hover: {
},
select: {
fill: '#039',
style: {
color: 'white'
}
}
}
},
labelStyle: {
color: 'silver',
fontWeight: 'bold'
},
selected: 1
},
series: [{
name: unit_name,
data: averages,
zIndex: 1,
marker: {
fillColor: 'white',
lineWidth: 2,
lineColor: Highcharts.getOptions().colors[0]
}
}, {
name: '<?php echo __("Range","test-plugin"); ?>',
data: ranges,
type: 'arearange',
lineWidth: 0,
linkedTo: ':previous',
color: Highcharts.getOptions().colors[0],
fillOpacity: 0.3,
zIndex: 0
}]
});
請幫助我如何使用日期範圍與區域圖。 謝謝。
你可以提供一個現場演示樣http://jsfiddle.net – 2015-02-24 10:05:33
@RaeenHashemi這裏是jsfidle http://jsfiddle.net/73sox4ws/ http://jsfiddle.net/gh/get/jquer y/1.9.1/highslide-software/highcharts.com/tree/master/samples/stock/demo/basic-line/ – 2015-02-24 10:08:42