新聞中心
calendar.yearLabel | Object
設(shè)置 ECharts 日歷坐標(biāo)中年份標(biāo)簽。

站在用戶的角度思考問題,與客戶深入溝通,找到婁底網(wǎng)站設(shè)計(jì)與婁底網(wǎng)站推廣的解決方案,憑借多年的經(jīng)驗(yàn),讓設(shè)計(jì)與互聯(lián)網(wǎng)技術(shù)結(jié)合,創(chuàng)造個(gè)性化、用戶體驗(yàn)好的作品,建站類型包括:成都網(wǎng)站制作、做網(wǎng)站、外貿(mào)營銷網(wǎng)站建設(shè)、企業(yè)官網(wǎng)、英文網(wǎng)站、手機(jī)端網(wǎng)站、網(wǎng)站推廣、域名申請(qǐng)、雅安服務(wù)器托管、企業(yè)郵箱。業(yè)務(wù)覆蓋婁底地區(qū)。
calendar.yearLabel.show | boolean
[ default: true ]
是否在普通狀態(tài)下顯示標(biāo)簽。
calendar.yearLabel.margin | number
[ default: 30 ]
年份與軸線之間的距離
calendar.yearLabel.position | string
年份的位置 默認(rèn)橫向是'left' 豎向是'top'
可選:
- 'top'
- 'bottom'
- 'left'
- 'right'
calendar.yearLabel.formatter | string, Function
[ default: null ]
用來格式化年份文本,支持字符串模板和回調(diào)函數(shù)兩種形式。 默認(rèn)顯示當(dāng)前范圍的年 若區(qū)間跨年 顯示('start-end')
示例:
// 使用字符串模板,例如:['2017-10-11', '2018-01-21']
/*
模板變量{nameMap} 年份原本名稱 eg:'2017-2018'
模板變量{start} 開始年份 eg: 2017
模板變量{end} 結(jié)束年份 eg: 2018
*/
formatter: '{start}-{end}'
// 使用回調(diào)函數(shù)
/*
param.nameMap 年份原本名稱 eg:'2017-2018'
param.start 開始年份 eg: 2017
param.end 結(jié)束年份 eg: 2018
*/
formatter: function (param) {
// ...
return param.end;
}calendar.yearLabel.color | Color
[ default: "#fff" ]
文字的顏色。
calendar.yearLabel.fontStyle | string
[ default: 'normal' ]
文字字體的風(fēng)格
可選:
- 'normal'
- 'italic'
- 'oblique'
calendar.yearLabel.fontWeight | string
[ default: normal ]
文字字體的粗細(xì)
可選:
- 'normal'
- 'bold'
- 'bolder'
- 'lighter'
- 100 | 200 | 300 | 400...
calendar.yearLabel.fontFamily | string
[ default: 'sans-serif' ]
文字的字體系列
還可以是 'serif' , 'monospace', 'Arial', 'Courier New', 'Microsoft YaHei', ...
calendar.yearLabel.fontSize | number
[ default: 12 ]
文字的字體大小
calendar.yearLabel.align | string
文字水平對(duì)齊方式,默認(rèn)自動(dòng)。
可選:
- 'left'
- 'center'
- 'right'
rich 中如果沒有設(shè)置 align,則會(huì)取父層級(jí)的 align。例如:
{
align: right,
rich: {
a: {
// 沒有設(shè)置 `align`,則 `align` 為 right
}
}
}calendar.yearLabel.verticalAlign | string
文字垂直對(duì)齊方式,默認(rèn)自動(dòng)。
可選:
- 'top'
- 'middle'
- 'bottom'
rich 中如果沒有設(shè)置 verticalAlign,則會(huì)取父層級(jí)的 verticalAlign。例如:
{
verticalAlign: bottom,
rich: {
a: {
// 沒有設(shè)置 `verticalAlign`,則 `verticalAlign` 為 bottom
}
}
}calendar.yearLabel.lineHeight | number
行高。
rich 中如果沒有設(shè)置 lineHeight,則會(huì)取父層級(jí)的 lineHeight。例如:
{
lineHeight: 56,
rich: {
a: {
// 沒有設(shè)置 `lineHeight`,則 `lineHeight` 為 56
}
}
}calendar.yearLabel.backgroundColor | string, Object
[ default: 'transparent' ]
文字塊背景色。
可以是直接的顏色值,例如:'#123234', 'red', rgba(0,23,11,0.3)'。
可以支持使用圖片,例如:
backgroundColor: {
image: 'xxx/xxx.png'
// 這里可以是圖片的 URL,
// 或者圖片的 dataURI,
// 或者 HTMLImageElement 對(duì)象,
// 或者 HTMLCanvasElement 對(duì)象。
}當(dāng)使用圖片的時(shí)候,可以使用 width 或 height 指定高寬,也可以不指定自適應(yīng)。
calendar.yearLabel.borderColor | string
[ default: 'transparent' ]
文字塊邊框顏色。
calendar.yearLabel.borderWidth | number
[ default: 0 ]
文字塊邊框?qū)挾取?/p>
calendar.yearLabel.borderRadius | number, Array
[ default: 0 ]
文字塊的圓角。
calendar.yearLabel.padding | number, Array
[ default: 0 ]
文字塊的內(nèi)邊距。例如:
- padding: [3, 4, 5, 6]:表示 [上, 右, 下, 左] 的邊距。
- padding: 4:表示 padding: [4, 4, 4, 4]。
- padding: [3, 4]:表示 padding: [3, 4, 3, 4]。
注意,文字塊的 width 和 height 指定的是內(nèi)容高寬,不包含 padding。
calendar.yearLabel.shadowColor | string
[ default: 'transparent' ]
文字塊的背景陰影顏色。
calendar.yearLabel.shadowBlur | number
[ default: 0 ]
文字塊的背景陰影長度。
calendar.yearLabel.shadowOffsetX | number
[ default: 0 ]
文字塊的背景陰影 X 偏移。
calendar.yearLabel.shadowOffsetY | number
[ default: 0 ]
文字塊的背景陰影 Y 偏移。
calendar.yearLabel.width | number, string
文字塊的寬度。一般不用指定,不指定則自動(dòng)是文字的寬度。在想做表格項(xiàng)或者使用圖片(參見 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。calendar.yearLabel.height | number, string
文字塊的高度。一般不用指定,不指定則自動(dòng)是文字的高度。在使用圖片(參見 backgroundColor)時(shí),可能會(huì)使用它。
注意,文字塊的 width 和 height 指定的是內(nèi)容高寬,不包含 padding;如果不定義 rich 屬性,則不能指定 width 和 height。calendar.yearLabel.textBorderColor | string
[ default: 'transparent' ]
文字本身的描邊顏色。
calendar.yearLabel.textBorderWidth | number
[ default: 0 ]
文字本身的描邊寬度。
calendar.yearLabel.textShadowColor | string
[ default: 'transparent' ]
文字本身的陰影顏色。
calendar.yearLabel.textShadowBlur | number
[ default: 0 ]
文字本身的陰影長度。
calendar.yearLabel.textShadowOffsetX | number
[ default: 0 ]
文字本身的陰影 X 偏移。
calendar.yearLabel.textShadowOffsetY | number
[ default: 0 ]
文字本身的陰影 Y 偏移。
calendar.yearLabel.rich | Object
在 rich 里面,可以自定義富文本樣式。利用富文本樣式,可以在標(biāo)簽中做出非常豐富的效果。
例如:
label: {
normal: {
// 在文本中,可以對(duì)部分文本采用 rich 中定義樣式。
// 這里需要在文本中使用標(biāo)記符號(hào):
// `{styleName|text content text content}` 標(biāo)記樣式名。
// 注意,換行仍是使用 '\n'。
formatter: [
'{a|這段文本采用樣式a}',
'{b|這段文本采用樣式b}這段用默認(rèn)樣式{x|這段用樣式x}'
].join('\n'),
rich: {
a: {
color: 'red',
lineHeight: 10
},
b: {
backgroundColor: {
image: 'xxx/xxx.jpg'
},
height: 40
},
x: {
fontSize: 18,
fontFamily: 'Microsoft YaHei',
borderColor: '#449933',
borderRadius: 4
},
...
}
}
}詳情參見教程:富文本標(biāo)簽
網(wǎng)頁題目:創(chuàng)新互聯(lián)ECharts教程:ECharts日歷坐標(biāo)系年份標(biāo)簽樣式
網(wǎng)站網(wǎng)址:http://www.dlmjj.cn/article/dphcpes.html


咨詢
建站咨詢
