柱狀圖:
$('#container').highcharts({
//突顯紅色柱;
series: [ 523, 345, 785, 565, 843,{'color': 'red','y': 300},726, 590, 665, 434, 312, 432]
})
餅圖、環型圖:
$('#container').highcharts({
//百分比環形圖;
plotOptions:{
pie: {
innerSize: 140,//等於0時,為餅圖;
allowPointSelect: true,
cursor: 'pointer',
colors: [
"#f44a36","#4879df",#21c393",#fad567"
]
}
}
})
動態實時刷新曲線圖(setInterval(放入動態數據),1000);
Highcharts選項配置詳細說明文檔
Highcharts API官方文檔
//蜘蛛圖
$('#container').highcharts({
yAxis: {
gridLinInterpolation: 'polygon',
min: 0,
tickInterval: 1,
max: 5,
gridLineColor: '#000000',
lineColor: '#000000',//背景顏色;
labels: {
enabled: false
}
},
//隱藏圖標頭;
title: {
text: '',
x: -80
},
//隱藏logo水印;
credits: {
enabled: false,
},
//隱藏注釋圖標;
legend: {
enabled: false
},//圖表的打印及導出功能失效
exporting:{
enabled:false
},
//更換顏色;
series: [{
name: '',
data: charInfo,
//color:'#ff0000';//線條顏色
}]
});
//百分比堆積柱狀圖:
$('#container').highcharts({
//百分比柱狀圖顏色;
chart: {
type: 'bar' //bar垂直;column水平;
},
plotOptions: {
bar: { //上下對應;
stacking: 'percent'
},
},
});
