1.提示框的背景踱蠢,邊框?qū)挾缺诱溃吙蝾伾?/h2>
tooltip: {
backgroundColor:'#ff0000',
borderWidth: 1,
borderColor: '#AAA'
},
2.格式化提示框:
tooltip: {
backgroundColor:'#ff0000',
borderWidth: 1,
borderColor: '#AAA'
},
formatter:
數(shù)據(jù)提示框格式化函數(shù)弛槐,功能最強(qiáng)大也是最靈活的方法教届,函數(shù)里 this 關(guān)鍵字代表著當(dāng)前數(shù)據(jù)點(diǎn)對象响鹃,常用的變量有:
this.x : 當(dāng)前點(diǎn) X 值
(一下屬性需要數(shù)據(jù)共享,既全部內(nèi)容顯示在一個(gè)框里對比)
this.y / this.point[i].y : 當(dāng)前點(diǎn)的 Y 值/ 當(dāng)前第 i 個(gè)點(diǎn)的 Y 值
this.point / this.point[i] : 當(dāng)前點(diǎn) / 當(dāng)前第 i 個(gè)點(diǎn)
this.series / this.point[i].series : 當(dāng)前數(shù)據(jù)列 / 當(dāng)前第 i 個(gè)點(diǎn)的數(shù)據(jù)列
3.后綴單位:
valuePrefix案训、valueSuffix 來給數(shù)據(jù)添加前綴及后綴买置。
tooltip: {
valuePrefix: '¥',
valueSuffix: '元'
}
4.數(shù)據(jù)共享:
在有多組數(shù)據(jù)的時(shí)候,使用shared:true即可進(jìn)行數(shù)據(jù)共享
tooltip: {
backgroundColor:'#ff0000',
borderWidth: 1,
borderColor: '#AAA',
// formatter:function () {
// return this.y
// },
// pointFormat: '<span style="color:{series.color}">{series.name}</span>: <b>{point.percentage:.1f}%</b> ({point.y:,.0f} millions)<br/>',
shared: true
},
5.啟用十字準(zhǔn)星:
crosshairs: [true, true]