您的位置:58编程 > echarts 副标题 ECharts副标题文本的设置

echarts 副标题 ECharts副标题文本的设置

2023-04-15 06:33 ECharts教程

echarts 副标题 ECharts副标题文本的设置

echarts 副标题 ECharts副标题文本的设置

echarts 副标题

title.subtext   |   string

[ default: "" ]

副标题文本,支持使用 n 换行。


title.sublink   |   string

[ default: "" ]

副标题文本超链接。


title.subtarget   |   string

[ default: "blank" ]

指定窗口打开副标题超链接,可选:

  • "self" 当前窗口打开
  • "blank" 新窗口打开

title.subtextStyle   |   *

title.subtextStyle.color   |   Color

[ default: "#aaa" ]

副标题文字的颜色。


title.subtextStyle.fontStyle   |   string

[ default: "normal" ]

副标题文字字体的风格

可选:

  • "normal"
  • "italic"
  • "oblique"


title.subtextStyle.fontWeight   |   string

[ default: normal ]

副标题文字字体的粗细

可选:

  • "normal"
  • "bold"
  • "bolder"
  • "lighter"
  • 100 | 200 | 300 | 400...


title.subtextStyle.fontFamily   |   string

[ default: "sans-serif" ]

副标题文字的字体系列

还可以是 "serif" , "monospace", "Arial", "Courier New", "Microsoft YaHei", ...


title.subtextStyle.fontSize    |   number

[ default: 12 ]

副标题文字的字体大小


title.subtextStyle.align   |   string

文字水平对齐方式,默认自动。

可选:

  • "left"
  • "center"
  • "right"

rich 中如果没有设置 align,则会取父层级的 align。例如:

{
align: right,
rich: {
a: {
// 没有设置 `align`,则 `align` 为 right
}
}
}

title.subtextStyle.verticalAlign   |   string

文字垂直对齐方式,默认自动。

可选:

  • "top"
  • "middle"
  • "bottom"

rich 中如果没有设置 verticalAlign,则会取父层级的 verticalAlign。例如:

{
verticalAlign: bottom,
rich: {
a: {
// 没有设置 `verticalAlign`,则 `verticalAlign` 为 bottom
}
}
}


title.subtextStyle.lineHeight   |   number

行高。

rich 中如果没有设置 lineHeight,则会取父层级的 lineHeight。例如:

{
lineHeight: 56,
rich: {
a: {
// 没有设置 `lineHeight`,则 `lineHeight` 为 56
}
}
}


title.subtextStyle.width    |   number, string

文字块的宽度。一般不用指定,不指定则自动是文字的宽度。在想做表格项或者使用图片(参见 backgroundColor)时,可能会使用它。

注意,文字块的 width 和 height 指定的是内容高宽,不包含 padding。

width 也可以是百分比字符串,如 "100%"。表示的是所在文本块的 contentWidth(即不包含文本块的 padding)的百分之多少。之所以以 contentWidth 做基数,因为每个文本片段只能基于 content box 布局。如果以 outerWidth 做基数,则百分比的计算在实用中不具有意义,可能会超出。

注意,如果不定义 rich 属性,则不能指定 width 和 height。


title.subtextStyle.height   |   number, string

文字块的高度。一般不用指定,不指定则自动是文字的高度。在使用图片(参见 backgroundColor)时,可能会使用它。

注意,文字块的 width 和 height 指定的是内容高宽,不包含 padding。

注意,如果不定义 rich 属性,则不能指定 width 和 height。


title.subtextStyle.textBorderColor   |   string

[ default: "transparent" ]

文字本身的描边颜色。


title.subtextStyle.textBorderWidth   |   number

[ default: 0 ]

文字本身的描边宽度。


title.subtextStyle.textShadowColor   |   string

[ default: "transparent" ]

文字本身的阴影颜色。


title.subtextStyle.textShadowBlur   |   number

[ default: 0 ]

文字本身的阴影长度。


title.subtextStyle.textShadowOffsetX   |  number

[ default: 0 ]

文字本身的阴影 X 偏移。


title.subtextStyle.textShadowOffsetY   |   number

[ default: 0 ]

文字本身的阴影 Y 偏移。

阅读全文
以上是58编程为你收集整理的echarts 副标题 ECharts副标题文本的设置全部内容。
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。
相关文章
© 2024 58编程 58biancheng.com 版权所有 联系我们
桂ICP备12005667号-32 Powered by CMS