BkS*_*ouX 1 javascript highcharts gauge
我对Highcharts测量仪有问题.实际上,它没有显示,我有一个JS错误.
TypeError: $[b.defaultSeriesType] is not a constructor highcharts.js(第159行)
我有3个标签(使用bootstrap/jquery)和另外两个饼图,这些没有问题.
我不明白,因为我刚从Highcharts网站复制了这个例子.有没有人有任何想法可能导致这个?
编辑:
这是JS的一部分
chart = new Highcharts.Chart({
chart : {
renderTo : 'container',
type : 'gauge',
plotBackgroundColor : null,
plotBackgroundImage : null,
plotBorderWidth : 0,
plotShadow : false
},
title : {
text : 'Speedometer'
},
pane : {
startAngle : -150,
endAngle : 150,
background : [
{
backgroundColor : {
linearGradient : {
x1 : 0,
y1 : 0,
x2 : 0,
y2 : 1
},
stops : [
[ 0, '#FFF' ],
[ 1, '#333' ] ]
},
borderWidth : 0,
outerRadius : '109%'
},
{
backgroundColor : {
linearGradient : {
x1 : 0,
y1 : 0,
x2 : 0,
y2 : 1
},
stops : [
[ 0, '#333' ],
[ 1, '#FFF' ] ]
},
borderWidth : 1,
outerRadius : '107%'
}, {
// default background
}, {
backgroundColor : '#DDD',
borderWidth : 0,
outerRadius : '105%',
innerRadius : '103%'
} ]
},
// the value axis
yAxis : {
min : 0,
max : 200,
minorTickInterval : 'auto',
minorTickWidth : 1,
minorTickLength : 10,
minorTickPosition : 'inside',
minorTickColor : '#666',
tickPixelInterval : 30,
tickWidth : 2,
tickPosition : 'inside',
tickLength : 10,
tickColor : '#666',
labels : {
step : 2,
rotation : 'auto'
},
title : {
text : 'km/h'
},
plotBands : [ {
from : 0,
to : 120,
color : '#55BF3B' // green
}, {
from : 120,
to : 160,
color : '#DDDF0D' // yellow
}, {
from : 160,
to : 200,
color : '#DF5353' // red
} ]
},
series : [ {
name : 'Speed',
data : [ 80 ],
tooltip : {
valueSuffix : ' km/h'
}
} ]
});
Run Code Online (Sandbox Code Playgroud)
在我的HTML中,我有这个
<div class="tab-pane fade" id="requetesSeconde">
<div id="container"
style="width: 400px; height: 300px; margin: 0 auto"></div>
</div>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3851 次 |
| 最近记录: |