新聞中心
與其他的一些 ECharts 圖表組件文本樣式的設(shè)置相似,我們?cè)谠O(shè)置極坐標(biāo)系的 tooltip 文本樣式的時(shí)候,需要設(shè)置的樣式也是文本中文字的顏色、文字字體的風(fēng)格、文字字體的大小、文字塊、文字陰影等等。下面是詳細(xì)的設(shè)置過(guò)程:

成都創(chuàng)新互聯(lián)專業(yè)為企業(yè)提供科爾沁左翼網(wǎng)站建設(shè)、科爾沁左翼做網(wǎng)站、科爾沁左翼網(wǎng)站設(shè)計(jì)、科爾沁左翼網(wǎng)站制作等企業(yè)網(wǎng)站建設(shè)、網(wǎng)頁(yè)設(shè)計(jì)與制作、科爾沁左翼企業(yè)網(wǎng)站模板建站服務(wù),10多年科爾沁左翼做網(wǎng)站經(jīng)驗(yàn),不只是建網(wǎng)站,更提供有價(jià)值的思路和整體網(wǎng)絡(luò)服務(wù)。
polar.tooltip.textStyle | Object
設(shè)置極坐標(biāo)系提示框浮層的文本樣式。
polar.tooltip.textStyle.color | Color
[ default: '#fff' ]
提示框浮層文本文字的顏色。
polar.tooltip.textStyle.fontStyle | string
[ default: 'normal' ]
提示框浮層文本文字字體的風(fēng)格
可選:
- 'normal'
- 'italic'
- 'oblique'
polar.tooltip.textStyle.fontWeight | string
[ default: normal ]
提示框浮層文本文字字體的粗細(xì)
可選:
- 'normal'
- 'bold'
- 'bolder'
- 'lighter'
- 100 | 200 | 300 | 400...
polar.tooltip.textStyle.fontFamily | string
[ default: 'sans-serif' ]
提示框浮層文本文字的字體系列
還可以是 'serif' , 'monospace', 'Arial', 'Courier New', 'Microsoft YaHei', ...
polar.tooltip.textStyle.fontSize | number
[ default: 14 ]
提示框浮層文本文字的字體大小
polar.tooltip.textStyle.lineHeight | number
提示框浮層文本的行高。
rich 中如果沒(méi)有設(shè)置 lineHeight,則會(huì)取父層級(jí)的 lineHeight。例如:
{
lineHeight: 56,
rich: {
a: {
// 沒(méi)有設(shè)置 `lineHeight`,則 `lineHeight` 為 56
}
}
}
polar.tooltip.textStyle.width | number, string
提示框浮層文本文字塊的寬度。
一般不用指定,不指定則自動(dòng)是文字的寬度。在想做表格項(xiàng)或者使用圖片(參見(jiàn) backgroundColor)時(shí),可能會(huì)使用它。
注意,文字塊的 width 和 height 指定的是內(nèi)容高寬,不包含 padding。
width 也可以是百分比字符串,如 '100%'。表示的是所在文本塊的 contentWidth(即不包含文本塊的 padding)的百分之多少。之所以以 contentWidth 做基數(shù),因?yàn)槊總€(gè)文本片段只能基于 content box 布局。如果以 outerWidth 做基數(shù),則百分比的計(jì)算在實(shí)用中不具有意義,可能會(huì)超出。
注意,如果不定義 rich 屬性,則不能指定 width 和 height。
polar.tooltip.textStyle.height | number, string
提示框浮層文本文字塊的高度。
一般不用指定,不指定則自動(dòng)是文字的高度。在使用圖片(參見(jiàn) backgroundColor)時(shí),可能會(huì)使用它。
注意,文字塊的 width 和 height 指定的是內(nèi)容高寬,不包含 padding。
注意,如果不定義 rich 屬性,則不能指定 width 和 height。
polar.tooltip.textStyle.textBorderColor | string
[ default: 'transparent' ]
提示框浮層文本文字本身的描邊顏色。
polar.tooltip.textStyle.textBorderWidth | number
[ default: 0 ]
提示框浮層文本文字本身的描邊寬度。
polar.tooltip.textStyle.textShadowColor | string
[ default: 'transparent' ]
提示框浮層文本文字本身的陰影顏色。
polar.tooltip.textStyle.textShadowBlur | number
[ default: 0 ]
提示框浮層文本文字本身的陰影長(zhǎng)度。
polar.tooltip.textStyle.textShadowOffsetX | number
[ default: 0 ]
提示框浮層文本文字本身的陰影 X 偏移。
polar.tooltip.textStyle.textShadowOffsetY | number
[ default: 0 ]
提示框浮層文本文字本身的陰影 Y 偏移。
文章題目:創(chuàng)新互聯(lián)ECharts教程:極坐標(biāo)系tooltip文本樣式的設(shè)置
標(biāo)題網(wǎng)址:http://m.fisionsoft.com.cn/article/dphegog.html


咨詢
建站咨詢
