- title配置
- id
- show
- title. text = ‘’">title. text = ‘’
- title. link = ‘’">title. link = ‘’
- title. target = ‘blank’">title. target = ‘blank’
- title. textStyle">title. textStyle
- title.textStyle. color = ‘#333’">title.textStyle. color = ‘#333’
- title.textStyle. fontStyle = ‘normal’">title.textStyle. fontStyle = ‘normal’
- title. subtext = ‘’">title. subtext = ‘’
- title. sublink = ‘’">title. sublink = ‘’
- title. subtarget = ‘blank’">title. subtarget = ‘blank’
- title. subtextStyle">title. subtextStyle
- title. textAlign = ‘auto’">title. textAlign = ‘auto’
- title. textVerticalAlign = ‘auto’">title. textVerticalAlign = ‘auto’
- title. triggerEvent">title. triggerEvent
- 其他的样式就不用写了,具体的查看文档
上一篇说了,echarts的setOption方法主要配置图表的展示的各种各样的样式与数据,这一篇主要讲,setOption中的title的配置。 其实:每一个选项配置就是代表了echarts中一个组件。要展示title,就是要title组件。如果自己是按需导入,就需要导入title组件,如果不需要title,那么就可以不要导入title组件。例如:坐标系的展示也是组件,导航栏,图例等等。还有一些功能性的组件,比如:把当前展示图表保存为图片,缩放等都是组件提供的功能。
可以说,echarts的展示和各种交互的功能,都是一个一个小组件拼起来的,也就是setOption进行配置告诉echarts需要哪些组件以及组件展示成什么样子。
很多的组件的属性都是通用的。不同的组件的属性有很多相似的。
title配置
id
组件 ID。默认不指定。指定则可用于在 option 或者 API 中引用组件。Echarts5
以上没有这个配置了。
show
title. text = ‘’
string
title. link = ‘’
string
title. target = ‘blank’
string
指定窗口打开主标题超链接。
可选:
'self'
当前窗口打开'blank'
新窗口打开title. textStyle
Objecttitle.textStyle. color = ‘#333’
Color
title.textStyle. fontStyle = ‘normal’
string
主标题文字字体的风格。
可选:
'normal'
'italic'
'oblique'
所有的属性:{ color , fontStyle , fontWeight , fontFamily , fontSize , lineHeight , width , height , textBorderColor , textBorderWidth , textShadowColor , textShadowBlur , textShadowOffsetX , textShadowOffsetY , overflow , ellipsis , lineOverflow , rich }
title. subtext = ‘’
string
title. sublink = ‘’
string
title. subtarget = ‘blank’
string
指定窗口打开副标题超链接,可选:
'self'
当前窗口打开'blank'
新窗口打开title. subtextStyle
Object
所有属性
{ color , fontStyle , fontWeight , fontFamily , fontSize , align , verticalAlign , lineHeight , width , height , textBorderColor , textBorderWidth , textShadowColor , textShadowBlur , textShadowOffsetX , textShadowOffsetY , overflow , ellipsis , lineOverflow , rich }title. textAlign = ‘auto’
string
整体(包括 text 和 subtext)的水平对齐。
可选值:'auto'
、'left'
、'right'
、'center'
。
title. textVerticalAlign = ‘auto’
string
整体(包括 text 和 subtext)的垂直对齐。
可选值:'auto'
、'top'
、'bottom'
、'middle'
。
title. triggerEvent
boolean
是否触发事件。