var option = {
title :
{
show:true, // 显示策略,默认值true,可选为:true(显示) | false(隐藏)
text: '主标题', // 主标题文本,'\n'指定换行
link:'', // 主标题文本超链接,默认值true
target: null, // 指定窗口打开主标题超链接,支持'self' | 'blank',不指定等同为'blank'(新窗口)
subtext: '副标题', // 副标题文本,'\n'指定换行
sublink: '', // 副标题文本超链接
subtarget: null, // 指定窗口打开副标题超链接,支持'self' | 'blank',不指定等同为'blank'(新窗口)
x:'center', // 水平安放位置,默认为'left',可选为:'center' | 'left' | 'right' | {number}(x坐标,单位px)
y: 'top', // 垂直安放位置,默认为top,可选为:'top' | 'bottom' | 'center' | {number}(y坐标,单位px)
textAlign: null ,// 水平对齐方式,默认根据x设置自动调整,可选为: left' | 'right' | 'center
backgroundColor: 'rgba(0,0,0,0)', //标题背景颜色,默认'rgba(0,0,0,0)'透明
borderColor: '#ccc', // 标题边框颜色,默认'#ccc'
borderWidth: 0, // 标题边框线宽,单位px,默认为0(无边框)
padding: 5, // 标题内边距,单位px,默认各方向内边距为5,接受数组分别设定上右下左边距
itemGap: 10, // 主副标题纵向间隔,单位px,默认为10
textStyle: { // 主标题文本样式{"fontSize": 18,"fontWeight": "bolder","color": "#333"}
fontFamily: 'Arial',
fontSize: 12,
fontStyle: 'normal',
fontWeight: 'normal',
},
subtextStyle: { // 副标题文本样式{"color": "#aaa"}
fontFamily: 'Arial, Verdana, sans...',
fontSize: 12,
fontStyle: 'normal',
fontWeight: 'normal',
}
}
}
笔记:echarts 标题(title)设置
最新推荐文章于 2024-08-09 09:49:16 发布