{ "show": { "desc": "\n\n
是否显示 timeline 组件。如果设置为false,不会显示,但是功能还存在。
这个属性目前只支持为 slider,不需要更改。
轴的类型。可选值为:
\n'value'\n 数值轴,适用于连续数据。
'category'\n 类目轴,适用于离散的类目数据。
'time'\n 时间轴,适用于连续的时序数据,与数值轴相比时间轴带有时间的格式化,在刻度计算上也有所不同,例如会根据跨度的范围来决定使用月,星期,日还是小时范围的刻度。
表示当前选中项是哪项。比如,currentIndex 为 0 时,表示当前选中项为 timeline.data[0](即使用 options[0])。
表示是否自动播放。
\n", "uiControl": { "type": "boolean" } }, "rewind": { "desc": "\n\n表示是否反向播放。
\n", "uiControl": { "type": "boolean" } }, "loop": { "desc": "\n\n表示是否循环播放。
\n", "uiControl": { "type": "boolean", "default": "true" } }, "playInterval": { "desc": "\n\n表示播放的速度(跳动的间隔),单位毫秒(ms)。
\n", "uiControl": { "type": "number", "min": "0", "step": "20", "default": "2000" } }, "realtime": { "desc": "\n\n拖动圆点的时候,是否实时更新视图。
\n", "uiControl": { "type": "boolean", "default": "true" } }, "controlPosition": { "desc": "\n\n表示『播放』按钮的位置。可选值:'left'、'right'。
所有图形的 zlevel 值。
\nzlevel用于 Canvas 分层,不同zlevel值的图形会放置在不同的 Canvas 中,Canvas 分层是一种常见的优化手段。我们可以把一些图形变化频繁(例如有动画)的组件设置成一个单独的zlevel。需要注意的是过多的 Canvas 会引起内存开销的增大,在手机端上需要谨慎使用以防崩溃。
zlevel 大的 Canvas 会放在 zlevel 小的 Canvas 的上面。
组件的所有图形的z值。控制图形的前后顺序。z值小的图形会被z值大的图形覆盖。
z相比zlevel优先级更低,而且不会创建新的 Canvas。
timeline组件离容器左侧的距离。
\nleft 的值可以是像 20 这样的具体像素值,可以是像 '20%' 这样相对于容器高宽的百分比,也可以是 'left', 'center', 'right'。
如果 left 的值为'left', 'center', 'right',组件会根据相应的位置自动对齐。
timeline组件离容器上侧的距离。
\ntop 的值可以是像 20 这样的具体像素值,可以是像 '20%' 这样相对于容器高宽的百分比,也可以是 'top', 'middle', 'bottom'。
如果 top 的值为'top', 'middle', 'bottom',组件会根据相应的位置自动对齐。
timeline组件离容器右侧的距离。
\nright 的值可以是像 20 这样的具体像素值,可以是像 '20%' 这样相对于容器高宽的百分比。
默认自适应。
\n", "uiControl": { "type": "percent", "default": "0%" } }, "bottom": { "desc": "\n\ntimeline组件离容器下侧的距离。
\nbottom 的值可以是像 20 这样的具体像素值,可以是像 '20%' 这样相对于容器高宽的百分比。
默认自适应。
\n", "uiControl": { "type": "percent", "default": "0%" } }, "padding": { "desc": "\n\n\n\n\n\ntimeline内边距,单位px,默认各方向内边距为5,接受数组分别设定上右下左边距。
\n使用示例:
\n// 设置内边距为 5\npadding: 5\n// 设置上下的内边距为 5,左右的内边距为 10\npadding: [5, 10]\n// 分别设置四个方向的内边距\npadding: [\n 5, // 上\n 10, // 右\n 5, // 下\n 10, // 左\n]\n\n",
"uiControl": {
"type": "vector",
"min": "0",
"dims": "T,R,B,L"
}
},
"orient": {
"desc": "\n\n摆放方式,可选值有:
\n'vertical':竖直放置。'horizontal':水平放置。timeline,反向则首位颠倒过来。timeline标记的图形。
\nECharts 提供的标记类型包括
\n'circle', 'rect', 'roundRect', 'triangle', 'diamond', 'pin', 'arrow', 'none'
可以通过 'image://url' 设置为图片,其中 URL 为图片的链接,或者 dataURI。
URL 为图片链接例如:
\n'image://http://xxx.xxx.xxx/a/b.png'\nURL 为 dataURI 例如:
'image://data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/XBs/fNwfjZ0frl3/zy7////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABAALAAAAAAQABAAAAVVICSOZGlCQAosJ6mu7fiyZeKqNKToQGDsM8hBADgUXoGAiqhSvp5QAnQKGIgUhwFUYLCVDFCrKUE1lBavAViFIDlTImbKC5Gm2hB0SlBCBMQiB0UjIQA7'\n可以通过 'path://' 将图标设置为任意的矢量路径。这种方式相比于使用图片的方式,不用担心因为缩放而产生锯齿或模糊,而且可以设置为任意颜色。路径图形会自适应调整为合适的大小。路径的格式参见 SVG PathData。可以从 Adobe Illustrator 等工具编辑导出。
例如:
\n'path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z'\n",
"uiControl": {
"type": "icon",
"default": "circle"
}
},
"symbolSize": {
"desc": "\n\ntimeline标记的大小,可以设置成诸如 10 这样单一的数字,也可以用数组分开表示宽和高,例如 [20, 10] 表示标记宽为20,高为10。
timeline标记的旋转角度(而非弧度)。正值表示逆时针旋转。注意在 markLine 中当 symbol 为 'arrow' 时会忽略 symbolRotate 强制设置为切线的角度。
如果 symbol 是 path:// 的形式,是否在缩放时保持该图形的长宽比。
timeline标记相对于原本位置的偏移。默认情况下,标记会居中置放在数据对应的位置,但是如果 symbol 是自定义的矢量路径或者图片,就有可能不希望 symbol 居中。这时候可以使用该配置项配置 symbol 相对于原本居中的偏移,可以是绝对的像素值,也可以是相对的百分比。
\n例如 [0, '50%'] 就是把自己向上移动了一半的位置,在 symbol 图形是气泡的时候可以让图形下端的箭头对准数据点。
是否显示轴线。可以设置为 false 不显示轴线,则可以做出不同的样式效果。
timeline 线的颜色。
\n\n\n", "uiControl": { "type": "color" } }, "lineStyle.width": { "desc": "\n\n颜色可以使用 RGB 表示,比如
\n'rgb(128, 128, 128)',如果想要加上 alpha 通道表示不透明度,可以使用 RGBA,比如'rgba(128, 128, 128, 0.5)',也可以使用十六进制格式,比如'#ccc'。除了纯色之外颜色也支持渐变色和纹理填充\n// 线性渐变,前四个参数分别是 x0, y0, x2, y2, 范围从 0 - 1,相当于在图形包围盒中的百分比,如果 globalCoord 为 `true`,则该四个值是绝对的像素位置\ncolor: {\n type: 'linear',\n x: 0,\n y: 0,\n x2: 0,\n y2: 1,\n colorStops: [{\n offset: 0, color: 'red' // 0% 处的颜色\n }, {\n offset: 1, color: 'blue' // 100% 处的颜色\n }],\n global: false // 缺省为 false\n}\n// 径向渐变,前三个参数分别是圆心 x, y 和半径,取值同线性渐变\ncolor: {\n type: 'radial',\n x: 0.5,\n y: 0.5,\n r: 0.5,\n colorStops: [{\n offset: 0, color: 'red' // 0% 处的颜色\n }, {\n offset: 1, color: 'blue' // 100% 处的颜色\n }],\n global: false // 缺省为 false\n}\n// 纹理填充\ncolor: {\n image: imageDom, // 支持为 HTMLImageElement, HTMLCanvasElement,不支持路径字符串\n repeat: 'repeat' // 是否平铺,可以是 'repeat-x', 'repeat-y', 'no-repeat'\n}\n
timeline 线宽。
\n", "uiControl": { "type": "number", "value": "2", "min": "0", "step": "0.5" } }, "lineStyle.type": { "desc": "\n\ntimeline 线的类型。
\n可选:
\n'solid''dashed''dotted'图形阴影的模糊大小。该属性配合 shadowColor,shadowOffsetX, shadowOffsetY 一起设置图形的阴影效果。
示例:
\n{\n shadowColor: 'rgba(0, 0, 0, 0.5)',\n shadowBlur: 10\n}\n\n",
"uiControl": {
"type": "number",
"default": "",
"min": "0",
"step": "0.5"
}
},
"lineStyle.shadowColor": {
"desc": "\n\n阴影颜色。支持的格式同color。
阴影水平方向上的偏移距离。
\n", "uiControl": { "type": "number", "default": "0", "step": "0.5" } }, "lineStyle.shadowOffsetY": { "desc": "\n\n阴影垂直方向上的偏移距离。
\n", "uiControl": { "type": "number", "default": "0", "step": "0.5" } }, "lineStyle.opacity": { "desc": "\n\n图形透明度。支持从 0 到 1 的数字,为 0 时不绘制该图形。
\n", "uiControl": { "type": "number", "default": "1", "min": "0", "max": "1", "step": "0.01" } }, "label": { "desc": "轴的文本标签。emphasis 是文本高亮的样式,比如鼠标悬浮或者图例联动高亮的时候会使用 emphasis 作为文本的样式。
可选的配置方式:
\n'auto':\n 完全自动决定。
'left':\n 贴左边界放置。\n 当 timline.orient 为 'vertical' 时有效。
'right':当 timline.orient 为 'vertical' 时有效。\n 贴右边界放置。
'top':\n 贴上边界放置。\n 当 timline.orient 为 'horizontal' 时有效。
'bottom':\n 贴下边界放置。\n 当 timline.orient 为 'horizontal' 时有效。
number:\n 指定某个数值时,表示 label 和轴的距离。为 0 时则和坐标轴重合,可以为正负值,决定 label 在坐标轴的哪一边。
是否显示 label。
\n", "uiControl": { "type": "boolean", "default": "true" } }, "label.interval": { "desc": "label 的间隔。当指定为数值时,例如指定为 2,则每隔两个显示一个 label。
label 的旋转角度。正值表示逆时针旋转。
刻度标签的内容格式器,支持字符串模板和回调函数两种形式。
\n示例:
\n// 使用字符串模板,模板变量为刻度默认标签 {value}\nformatter: '{value} kg'\n\n对于时间轴(type: 'time'),formatter 的字符串模板支持多种形式:
string 类型Function 类型object 类型下面我们分别介绍这三种形式。
\n字符串模板
\n使用字符串模板是一种方便实现常用日期时间格式化方式的形式。如果字符串模板可以实现你的效果,那我们优先推荐使用此方式;如果无法实现,再考虑其他两种更复杂的方式。支持的模板如下:
\n| 分类 | \n模板 | \n取值(英文) | \n取值(中文) | \n
|---|---|---|---|
| Year | \n{yyyy} | \ne.g., 2020, 2021, ... | \n例:2020, 2021, ... | \n
| \n | {yy} | \n00-99 | \n00-99 | \n
| Quarter | \n{Q} | \n1, 2, 3, 4 | \n1, 2, 3, 4 | \n
| Month | \n{MMMM} | \ne.g., January, February, ... | \n一月、二月、…… | \n
| \n | {MMM} | \ne.g., Jan, Feb, ... | \n1月、2月、…… | \n
| \n | {MM} | \n01-12 | \n01-12 | \n
| \n | {M} | \n1-12 | \n1-12 | \n
| Day of Month | \n{dd} | \n01-31 | \n01-31 | \n
| \n | {d} | \n1-31 | \n1-31 | \n
| Day of Week | \n{eeee} | \nSunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday | \n星期日、星期一、星期二、星期三、星期四、星期五、星期六 | \n
| \n | {ee} | \nSun, Mon, Tues, Wed, Thu, Fri, Sat | \n日、一、二、三、四、五、六 | \n
| \n | {e} | \n1-54 | \n1-54 | \n
| Hour | \n{HH} | \n00-23 | \n00-23 | \n
| \n | {H} | \n0-23 | \n0-23 | \n
| \n | {hh} | \n01-12 | \n01-12 | \n
| \n | {h} | \n1-12 | \n1-12 | \n
| Minute | \n{mm} | \n00-59 | \n00-59 | \n
| \n | {m} | \n0-59 | \n0-59 | \n
| Second | \n{ss} | \n00-59 | \n00-59 | \n
| \n | {s} | \n0-59 | \n0-59 | \n
| Millisecond | \n{SSS} | \n000-999 | \n000-999 | \n
| \n | {S} | \n0-999 | \n0-999 | \n
\n\n其他语言请参考相应语言包中的定义,语言包可以通过 echarts.registerLocale 注册。
\n
示例:
\nformatter: '{yyyy}-{MM}-{dd}' // 得到的 label 形如:'2020-12-02'\nformatter: '{d}日' // 得到的 label 形如:'2日'\n\n回调函数
\n回调函数可以根据刻度值返回不同的格式,如果有复杂的时间格式化需求,也可以引用第三方的日期时间相关的库(如 Moment.js、date-fns 等),返回显示的文本。
\n示例:
\n// 使用函数模板,函数参数分别为刻度数值(类目),刻度的索引\nformatter: function (value, index) {\n // 格式化成月/日,只在第一个刻度显示年份\n var date = new Date(value);\n var texts = [(date.getMonth() + 1), date.getDate()];\n if (index === 0) {\n texts.unshift(date.getYear());\n }\n return texts.join('/');\n}\n\n分级模板
\n有时候,我们希望对不同的时间粒度采用不同的格式化策略。例如,在季度图表中,我们可能希望对每个月的第一天显示月份,而其他日期显示日期。我们可以使用以下方式实现该效果:
\n示例:
\nformatter: {\n month: '{MMMM}', // 一月、二月、……\n day: '{d}日' // 1日、2日、……\n}\n\n支持的分级以及各自默认的取值为:
\n{\n year: '{yyyy}',\n month: '{MMM}',\n day: '{d}',\n hour: '{HH}:{mm}',\n minute: '{HH}:{mm}',\n second: '{HH}:{mm}:{ss}',\n millisecond: '{hh}:{mm}:{ss} {SSS}',\n none: '{yyyy}-{MM}-{dd} {hh}:{mm}:{ss} {SSS}'\n}\n\n以 day 为例,当一个刻度点的值的小时、分钟、秒、毫秒都为 0 时,将采用 day 的分级值作为模板。none 表示当其他规则都不适用时采用的模板,也就是带有毫秒值的刻度点的模板。
富文本
\n以上这三种形式的 formatter 都支持富文本,所以可以做成一些复杂的效果。
\n示例:
\nxAxis: {\n type: 'time',\n axisLabel: {\n formatter: {\n // 一年的第一个月显示年度信息和月份信息\n year: '{yearStyle|{yyyy}}\\n{monthStyle|{MMM}}',\n month: '{monthStyle|{MMM}}'\n },\n rich: {\n yearStyle: {\n // 让年度信息更醒目\n color: '#000',\n fontWeight: 'bold'\n },\n monthStyle: {\n color: '#999'\n }\n }\n }\n},\n\n使用回调函数形式实现上面例子同样的效果:
\n示例:
\nxAxis: {\n type: 'time',\n axisLabel: {\n formatter: function (value) {\n const date = new Date(value);\n const yearStart = new Date(value);\n yearStart.setMonth(0);\n yearStart.setDate(1);\n yearStart.setHours(0);\n yearStart.setMinutes(0);\n yearStart.setSeconds(0);\n yearStart.setMilliseconds(0);\n // 判断一个刻度值知否为一年的开始\n if (date.getTime() === yearStart.getTime()) {\n return '{year|' + date.getFullYear() + '}\\n'\n + '{month|' + (date.getMonth() + 1) + '月}';\n }\n else {\n return '{month|' + (date.getMonth() + 1) + '月}'\n }\n },\n rich: {\n year: {\n color: '#000',\n fontWeight: 'bold'\n },\n month: {\n color: '#999'\n }\n }\n }\n},\n\n"
},
"label.color": {
"desc": "\n\ntimeline.lable文字的颜色。
\n", "uiControl": { "type": "color", "default": "'#A4B1D7'" } }, "label.fontStyle": { "desc": "\n\ntimeline.lable文字字体的风格。
\n可选:
\n'normal''italic''oblique'timeline.lable文字字体的粗细。
\n可选:
\n'normal''bold''bolder''lighter'timeline.lable文字的字体系列。
\n还可以是 'serif' , 'monospace', 'Arial', 'Courier New', 'Microsoft YaHei', ...
\n", "uiControl": { "type": "enum", "default": "sans-serif", "options": "sans-serif,serif,monospace,Arial,Courier New" } }, "label.fontSize": { "desc": "\n\ntimeline.lable文字的字体大小。
\n", "uiControl": { "type": "number", "default": "12", "min": "1", "step": "1" } }, "label.align": { "desc": "\n\n文字水平对齐方式,默认自动。
\n可选:
\n'left''center''right'rich 中如果没有设置 align,则会取父层级的 align。例如:
{\n align: right,\n rich: {\n a: {\n // 没有设置 `align`,则 `align` 为 right\n }\n }\n}\n\n",
"uiControl": {
"type": "enum",
"options": "left,center,right"
}
},
"label.verticalAlign": {
"desc": "\n\n文字垂直对齐方式,默认自动。
\n可选:
\n'top''middle''bottom'rich 中如果没有设置 verticalAlign,则会取父层级的 verticalAlign。例如:
{\n verticalAlign: bottom,\n rich: {\n a: {\n // 没有设置 `verticalAlign`,则 `verticalAlign` 为 bottom\n }\n }\n}\n\n",
"uiControl": {
"type": "enum",
"options": "top,middle,bottom"
}
},
"label.lineHeight": {
"desc": "\n\n行高。
\nrich 中如果没有设置 lineHeight,则会取父层级的 lineHeight。例如:
{\n lineHeight: 56,\n rich: {\n a: {\n // 没有设置 `lineHeight`,则 `lineHeight` 为 56\n }\n }\n}\n\n",
"uiControl": {
"type": "number",
"min": "0",
"step": "1",
"default": "12"
}
},
"label.backgroundColor": {
"desc": "\n\n文字块背景色。
\n可以使用颜色值,例如:'#123234', 'red', 'rgba(0,23,11,0.3)'。
也可以直接使用图片,例如:
\nbackgroundColor: {\n image: 'xxx/xxx.png'\n // 这里可以是图片的 URL,\n // 或者图片的 dataURI,\n // 或者 HTMLImageElement 对象,\n // 或者 HTMLCanvasElement 对象。\n}\n\n当使用图片的时候,可以使用 width 或 height 指定高宽,也可以不指定自适应。
文字块边框颜色。
\n", "uiControl": { "type": "color", "default": "#fff" } }, "label.borderWidth": { "desc": "\n\n文字块边框宽度。
\n", "uiControl": { "type": "number", "min": "0", "step": "0.5" } }, "label.borderRadius": { "desc": "\n\n文字块的圆角。
\n", "uiControl": { "type": "vector", "min": "0", "dims": "LT,RT, RB, LB" } }, "label.padding": { "desc": "\n\n文字块的内边距。例如:
\npadding: [3, 4, 5, 6]:表示 [上, 右, 下, 左] 的边距。padding: 4:表示 padding: [4, 4, 4, 4]。padding: [3, 4]:表示 padding: [3, 4, 3, 4]。注意,文字块的 width 和 height 指定的是内容高宽,不包含 padding。
文字块的背景阴影颜色。
\n", "uiControl": { "type": "color" } }, "label.shadowBlur": { "desc": "\n\n文字块的背景阴影长度。
\n", "uiControl": { "type": "number", "min": "0", "step": "0.5" } }, "label.shadowOffsetX": { "desc": "\n\n文字块的背景阴影 X 偏移。
\n", "uiControl": { "type": "number", "step": "0.5" } }, "label.shadowOffsetY": { "desc": "\n\n文字块的背景阴影 Y 偏移。
\n", "uiControl": { "type": "number", "step": "0.5" } }, "label.width": { "desc": "\n\n文本显示宽度。
\n", "uiControl": { "type": "number", "default": "100", "min": "1", "max": "500", "step": "1" } }, "label.height": { "desc": "\n\n文本显示高度。
\n", "uiControl": { "type": "number", "default": "50", "min": "1", "max": "500", "step": "1" } }, "label.textBorderColor": { "desc": "\n\n文字本身的描边颜色。
\n", "uiControl": { "type": "color" } }, "label.textBorderWidth": { "desc": "\n\n文字本身的描边宽度。
\n", "uiControl": { "type": "number", "min": "0", "step": "0.5" } }, "label.textShadowColor": { "desc": "\n\n文字本身的阴影颜色。
\n", "uiControl": { "type": "color", "default": "#000" } }, "label.textShadowBlur": { "desc": "\n\n文字本身的阴影长度。
\n", "uiControl": { "type": "number", "min": "0", "step": "0.5" } }, "label.textShadowOffsetX": { "desc": "\n\n文字本身的阴影 X 偏移。
\n", "uiControl": { "type": "number", "step": "0.5" } }, "label.textShadowOffsetY": { "desc": "\n\n文字本身的阴影 Y 偏移。
\n", "uiControl": { "type": "number", "step": "0.5" } }, "label.overflow": { "desc": "\n\n文字超出宽度是否截断或者换行。配置width时有效
'truncate' 截断,并在末尾显示ellipsis配置的文本,默认为...'break' 换行'breakAll' 换行,跟'break'不同的是,在英语等拉丁文中,'breakAll'还会强制单词内换行在overflow配置为'truncate'的时候,可以通过该属性配置末尾显示的文本。
文本超出高度部分是否截断,配置height时有效。
'truncate' 在文本行数超出高度部分截断。在 rich 里面,可以自定义富文本样式。利用富文本样式,可以在标签中做出非常丰富的效果。
例如:
\nlabel: {\n // 在文本中,可以对部分文本采用 rich 中定义样式。\n // 这里需要在文本中使用标记符号:\n // `{styleName|text content text content}` 标记样式名。\n // 注意,换行仍是使用 '\\n'。\n formatter: [\n '{a|这段文本采用样式a}',\n '{b|这段文本采用样式b}这段用默认样式{x|这段用样式x}'\n ].join('\\n'),\n\n rich: {\n a: {\n color: 'red',\n lineHeight: 10\n },\n b: {\n backgroundColor: {\n image: 'xxx/xxx.jpg'\n },\n height: 40\n },\n x: {\n fontSize: 18,\n fontFamily: 'Microsoft YaHei',\n borderColor: '#449933',\n borderRadius: 4\n },\n ...\n }\n}\n\n详情参见教程:富文本标签
\n" }, "label.rich.文字的颜色。
\n", "uiControl": { "type": "color", "default": "null" } }, "label.rich.文字字体的风格。
\n可选:
\n'normal''italic''oblique'文字字体的粗细。
\n可选:
\n'normal''bold''bolder''lighter'文字的字体系列。
\n还可以是 'serif' , 'monospace', 'Arial', 'Courier New', 'Microsoft YaHei', ...
\n", "uiControl": { "type": "enum", "default": "sans-serif", "options": "sans-serif,serif,monospace,Arial,Courier New" } }, "label.rich.文字的字体大小。
\n", "uiControl": { "type": "number", "default": "12", "min": "1", "step": "1" } }, "label.rich.文字水平对齐方式,默认自动。
\n可选:
\n'left''center''right'rich 中如果没有设置 align,则会取父层级的 align。例如:
{\n align: right,\n rich: {\n a: {\n // 没有设置 `align`,则 `align` 为 right\n }\n }\n}\n\n",
"uiControl": {
"type": "enum",
"options": "left,center,right"
}
},
"label.rich.文字垂直对齐方式,默认自动。
\n可选:
\n'top''middle''bottom'rich 中如果没有设置 verticalAlign,则会取父层级的 verticalAlign。例如:
{\n verticalAlign: bottom,\n rich: {\n a: {\n // 没有设置 `verticalAlign`,则 `verticalAlign` 为 bottom\n }\n }\n}\n\n",
"uiControl": {
"type": "enum",
"options": "top,middle,bottom"
}
},
"label.rich.行高。
\nrich 中如果没有设置 lineHeight,则会取父层级的 lineHeight。例如:
{\n lineHeight: 56,\n rich: {\n a: {\n // 没有设置 `lineHeight`,则 `lineHeight` 为 56\n }\n }\n}\n\n",
"uiControl": {
"type": "number",
"min": "0",
"step": "1",
"default": "12"
}
},
"label.rich.文字块背景色。
\n可以使用颜色值,例如:'#123234', 'red', 'rgba(0,23,11,0.3)'。
也可以直接使用图片,例如:
\nbackgroundColor: {\n image: 'xxx/xxx.png'\n // 这里可以是图片的 URL,\n // 或者图片的 dataURI,\n // 或者 HTMLImageElement 对象,\n // 或者 HTMLCanvasElement 对象。\n}\n\n当使用图片的时候,可以使用 width 或 height 指定高宽,也可以不指定自适应。
文字块边框颜色。
\n", "uiControl": { "type": "color", "default": "#fff" } }, "label.rich.文字块边框宽度。
\n", "uiControl": { "type": "number", "min": "0", "step": "0.5" } }, "label.rich.文字块的圆角。
\n", "uiControl": { "type": "vector", "min": "0", "dims": "LT,RT, RB, LB" } }, "label.rich.文字块的内边距。例如:
\npadding: [3, 4, 5, 6]:表示 [上, 右, 下, 左] 的边距。padding: 4:表示 padding: [4, 4, 4, 4]。padding: [3, 4]:表示 padding: [3, 4, 3, 4]。注意,文字块的 width 和 height 指定的是内容高宽,不包含 padding。
文字块的背景阴影颜色。
\n", "uiControl": { "type": "color" } }, "label.rich.文字块的背景阴影长度。
\n", "uiControl": { "type": "number", "min": "0", "step": "0.5" } }, "label.rich.文字块的背景阴影 X 偏移。
\n", "uiControl": { "type": "number", "step": "0.5" } }, "label.rich.文字块的背景阴影 Y 偏移。
\n", "uiControl": { "type": "number", "step": "0.5" } }, "label.rich.文字块的宽度。一般不用指定,不指定则自动是文字的宽度。在想做表格项或者使用图片(参见 backgroundColor)时,可能会使用它。
注意,文字块的 width 和 height 指定的是内容高宽,不包含 padding。
width 也可以是百分比字符串,如 '100%'。表示的是所在文本块的 contentWidth(即不包含文本块的 padding)的百分之多少。之所以以 contentWidth 做基数,因为每个文本片段只能基于 content box 布局。如果以 outerWidth 做基数,则百分比的计算在实用中不具有意义,可能会超出。
注意,如果不定义 rich 属性,则不能指定 width 和 height。
文字块的高度。一般不用指定,不指定则自动是文字的高度。在使用图片(参见 backgroundColor)时,可能会使用它。
注意,文字块的 width 和 height 指定的是内容高宽,不包含 padding。
注意,如果不定义 rich 属性,则不能指定 width 和 height。
文字本身的描边颜色。
\n", "uiControl": { "type": "color" } }, "label.rich.文字本身的描边宽度。
\n", "uiControl": { "type": "number", "min": "0", "step": "0.5" } }, "label.rich.文字本身的阴影颜色。
\n", "uiControl": { "type": "color", "default": "#000" } }, "label.rich.文字本身的阴影长度。
\n", "uiControl": { "type": "number", "min": "0", "step": "0.5" } }, "label.rich.文字本身的阴影 X 偏移。
\n", "uiControl": { "type": "number", "step": "0.5" } }, "label.rich.文字本身的阴影 Y 偏移。
\n", "uiControl": { "type": "number", "step": "0.5" } }, "itemStyle": { "desc": "timeline 图形样式。
\n" }, "itemStyle.color": { "desc": "\n\ntimeline 图形的颜色。
\n\n\n", "uiControl": { "type": "color" } }, "itemStyle.borderColor": { "desc": "\n\n颜色可以使用 RGB 表示,比如
\n'rgb(128, 128, 128)',如果想要加上 alpha 通道表示不透明度,可以使用 RGBA,比如'rgba(128, 128, 128, 0.5)',也可以使用十六进制格式,比如'#ccc'。除了纯色之外颜色也支持渐变色和纹理填充\n// 线性渐变,前四个参数分别是 x0, y0, x2, y2, 范围从 0 - 1,相当于在图形包围盒中的百分比,如果 globalCoord 为 `true`,则该四个值是绝对的像素位置\ncolor: {\n type: 'linear',\n x: 0,\n y: 0,\n x2: 0,\n y2: 1,\n colorStops: [{\n offset: 0, color: 'red' // 0% 处的颜色\n }, {\n offset: 1, color: 'blue' // 100% 处的颜色\n }],\n global: false // 缺省为 false\n}\n// 径向渐变,前三个参数分别是圆心 x, y 和半径,取值同线性渐变\ncolor: {\n type: 'radial',\n x: 0.5,\n y: 0.5,\n r: 0.5,\n colorStops: [{\n offset: 0, color: 'red' // 0% 处的颜色\n }, {\n offset: 1, color: 'blue' // 100% 处的颜色\n }],\n global: false // 缺省为 false\n}\n// 纹理填充\ncolor: {\n image: imageDom, // 支持为 HTMLImageElement, HTMLCanvasElement,不支持路径字符串\n repeat: 'repeat' // 是否平铺,可以是 'repeat-x', 'repeat-y', 'no-repeat'\n}\n
timeline 图形的描边颜色。支持的颜色格式同 color,不支持回调函数。
timeline 描边线宽。为 0 时无描边。
\n", "uiControl": { "type": "number", "value": "1", "min": "0", "step": "0.5" } }, "itemStyle.borderType": { "desc": "\n\n柱条的描边类型,默认为实线,支持 'solid', 'dashed', 'dotted'。
图形阴影的模糊大小。该属性配合 shadowColor,shadowOffsetX, shadowOffsetY 一起设置图形的阴影效果。
示例:
\n{\n shadowColor: 'rgba(0, 0, 0, 0.5)',\n shadowBlur: 10\n}\n\n",
"uiControl": {
"type": "number",
"default": "",
"min": "0",
"step": "0.5"
}
},
"itemStyle.shadowColor": {
"desc": "\n\n阴影颜色。支持的格式同color。
阴影水平方向上的偏移距离。
\n", "uiControl": { "type": "number", "default": "0", "step": "0.5" } }, "itemStyle.shadowOffsetY": { "desc": "\n\n阴影垂直方向上的偏移距离。
\n", "uiControl": { "type": "number", "default": "0", "step": "0.5" } }, "itemStyle.opacity": { "desc": "\n\n图形透明度。支持从 0 到 1 的数字,为 0 时不绘制该图形。
\n", "uiControl": { "type": "number", "default": "1", "min": "0", "max": "1", "step": "0.01" } }, "checkpointStyle": { "desc": "『当前项』(checkpoint)的图形样式。
timeline.checkpointStyle 标记的图形。
\nECharts 提供的标记类型包括
\n'circle', 'rect', 'roundRect', 'triangle', 'diamond', 'pin', 'arrow', 'none'
可以通过 'image://url' 设置为图片,其中 URL 为图片的链接,或者 dataURI。
URL 为图片链接例如:
\n'image://http://xxx.xxx.xxx/a/b.png'\nURL 为 dataURI 例如:
'image://data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/XBs/fNwfjZ0frl3/zy7////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABAALAAAAAAQABAAAAVVICSOZGlCQAosJ6mu7fiyZeKqNKToQGDsM8hBADgUXoGAiqhSvp5QAnQKGIgUhwFUYLCVDFCrKUE1lBavAViFIDlTImbKC5Gm2hB0SlBCBMQiB0UjIQA7'\n可以通过 'path://' 将图标设置为任意的矢量路径。这种方式相比于使用图片的方式,不用担心因为缩放而产生锯齿或模糊,而且可以设置为任意颜色。路径图形会自适应调整为合适的大小。路径的格式参见 SVG PathData。可以从 Adobe Illustrator 等工具编辑导出。
例如:
\n'path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z'\n",
"uiControl": {
"type": "icon",
"default": "circle"
}
},
"checkpointStyle.symbolSize": {
"desc": "\n\ntimeline.checkpointStyle 标记的大小,可以设置成诸如 10 这样单一的数字,也可以用数组分开表示宽和高,例如 [20, 10] 表示标记宽为20,高为10。
timeline.checkpointStyle 标记的旋转角度(而非弧度)。正值表示逆时针旋转。注意在 markLine 中当 symbol 为 'arrow' 时会忽略 symbolRotate 强制设置为切线的角度。
如果 symbol 是 path:// 的形式,是否在缩放时保持该图形的长宽比。
timeline.checkpointStyle 标记相对于原本位置的偏移。默认情况下,标记会居中置放在数据对应的位置,但是如果 symbol 是自定义的矢量路径或者图片,就有可能不希望 symbol 居中。这时候可以使用该配置项配置 symbol 相对于原本居中的偏移,可以是绝对的像素值,也可以是相对的百分比。
\n例如 [0, '50%'] 就是把自己向上移动了一半的位置,在 symbol 图形是气泡的时候可以让图形下端的箭头对准数据点。
图形的颜色。
\n\n\n", "uiControl": { "type": "color" } }, "checkpointStyle.borderColor": { "desc": "\n\n颜色可以使用 RGB 表示,比如
\n'rgb(128, 128, 128)',如果想要加上 alpha 通道表示不透明度,可以使用 RGBA,比如'rgba(128, 128, 128, 0.5)',也可以使用十六进制格式,比如'#ccc'。除了纯色之外颜色也支持渐变色和纹理填充\n// 线性渐变,前四个参数分别是 x0, y0, x2, y2, 范围从 0 - 1,相当于在图形包围盒中的百分比,如果 globalCoord 为 `true`,则该四个值是绝对的像素位置\ncolor: {\n type: 'linear',\n x: 0,\n y: 0,\n x2: 0,\n y2: 1,\n colorStops: [{\n offset: 0, color: 'red' // 0% 处的颜色\n }, {\n offset: 1, color: 'blue' // 100% 处的颜色\n }],\n global: false // 缺省为 false\n}\n// 径向渐变,前三个参数分别是圆心 x, y 和半径,取值同线性渐变\ncolor: {\n type: 'radial',\n x: 0.5,\n y: 0.5,\n r: 0.5,\n colorStops: [{\n offset: 0, color: 'red' // 0% 处的颜色\n }, {\n offset: 1, color: 'blue' // 100% 处的颜色\n }],\n global: false // 缺省为 false\n}\n// 纹理填充\ncolor: {\n image: imageDom, // 支持为 HTMLImageElement, HTMLCanvasElement,不支持路径字符串\n repeat: 'repeat' // 是否平铺,可以是 'repeat-x', 'repeat-y', 'no-repeat'\n}\n
图形的描边颜色。支持的颜色格式同 color,不支持回调函数。
描边线宽。为 0 时无描边。
\n", "uiControl": { "type": "number", "value": "2", "min": "0", "step": "0.5" } }, "checkpointStyle.borderType": { "desc": "\n\n柱条的描边类型,默认为实线,支持 'solid', 'dashed', 'dotted'。
图形阴影的模糊大小。该属性配合 shadowColor,shadowOffsetX, shadowOffsetY 一起设置图形的阴影效果。
示例:
\n{\n shadowColor: 'rgba(0, 0, 0, 0.5)',\n shadowBlur: 10\n}\n\n",
"uiControl": {
"type": "number",
"default": "2",
"min": "0",
"step": "0.5"
}
},
"checkpointStyle.shadowColor": {
"desc": "\n\n阴影颜色。支持的格式同color。
阴影水平方向上的偏移距离。
\n", "uiControl": { "type": "number", "default": "1", "step": "0.5" } }, "checkpointStyle.shadowOffsetY": { "desc": "\n\n阴影垂直方向上的偏移距离。
\n", "uiControl": { "type": "number", "default": "1", "step": "0.5" } }, "checkpointStyle.opacity": { "desc": "\n\n图形透明度。支持从 0 到 1 的数字,为 0 时不绘制该图形。
\n", "uiControl": { "type": "number", "default": "1", "min": "0", "max": "1", "step": "0.01" } }, "checkpointStyle.animation": { "desc": "\n\ntimeline组件中『当前项』(checkpoint)在 timeline 播放切换中的移动,是否有动画。
timeline组件中『当前项』(checkpoint)的动画时长。
timeline组件中『当前项』(checkpoint)的动画的缓动效果。不同的缓动效果可以参考 缓动示例。
『控制按钮』的样式。『控制按钮』包括:『播放按钮』、『前进按钮』、『后退按钮』。
\n" }, "controlStyle.show": { "desc": "\n\n是否显示『控制按钮』。设置为 false 则全不显示。
是否显示『播放按钮』。
\n", "uiControl": { "type": "boolean", "default": "true" } }, "controlStyle.showPrevBtn": { "desc": "\n\n是否显示『后退按钮』。
\n", "uiControl": { "type": "boolean", "default": "true" } }, "controlStyle.showNextBtn": { "desc": "\n\n是否显示『前进按钮』。
\n", "uiControl": { "type": "boolean", "default": "true" } }, "controlStyle.itemSize": { "desc": "\n\n『控制按钮』的尺寸,单位为像素(px)。
\n", "uiControl": { "type": "number", "min": "0", "step": "0.5", "default": "22" } }, "controlStyle.itemGap": { "desc": "\n\n『控制按钮』的间隔,单位为像素(px)。
\n", "uiControl": { "type": "number", "min": "0", "step": "0.5", "default": "12" } }, "controlStyle.position": { "desc": "\n\n『控制按钮』的位置。
\n当 timeline.orient 为 'horizontal'时,'left'、'right'有效。
当 timeline.orient 为 'vertical'时,'top'、'bottom'有效。
『播放按钮』的『可播放状态』的图形。
\n可以通过 'image://url' 设置为图片,其中 URL 为图片的链接,或者 dataURI。
URL 为图片链接例如:
\n'image://http://xxx.xxx.xxx/a/b.png'\nURL 为 dataURI 例如:
'image://data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/XBs/fNwfjZ0frl3/zy7////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABAALAAAAAAQABAAAAVVICSOZGlCQAosJ6mu7fiyZeKqNKToQGDsM8hBADgUXoGAiqhSvp5QAnQKGIgUhwFUYLCVDFCrKUE1lBavAViFIDlTImbKC5Gm2hB0SlBCBMQiB0UjIQA7'\n可以通过 'path://' 将图标设置为任意的矢量路径。这种方式相比于使用图片的方式,不用担心因为缩放而产生锯齿或模糊,而且可以设置为任意颜色。路径图形会自适应调整为合适的大小。路径的格式参见 SVG PathData。可以从 Adobe Illustrator 等工具编辑导出。
例如:
\n'path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z'\n",
"uiControl": {
"type": "icon"
}
},
"controlStyle.stopIcon": {
"desc": "\n\n『播放按钮』的『可停止状态』的图形。
\n可以通过 'image://url' 设置为图片,其中 URL 为图片的链接,或者 dataURI。
URL 为图片链接例如:
\n'image://http://xxx.xxx.xxx/a/b.png'\nURL 为 dataURI 例如:
'image://data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/XBs/fNwfjZ0frl3/zy7////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABAALAAAAAAQABAAAAVVICSOZGlCQAosJ6mu7fiyZeKqNKToQGDsM8hBADgUXoGAiqhSvp5QAnQKGIgUhwFUYLCVDFCrKUE1lBavAViFIDlTImbKC5Gm2hB0SlBCBMQiB0UjIQA7'\n可以通过 'path://' 将图标设置为任意的矢量路径。这种方式相比于使用图片的方式,不用担心因为缩放而产生锯齿或模糊,而且可以设置为任意颜色。路径图形会自适应调整为合适的大小。路径的格式参见 SVG PathData。可以从 Adobe Illustrator 等工具编辑导出。
例如:
\n'path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z'\n",
"uiControl": {
"type": "icon"
}
},
"controlStyle.prevIcon": {
"desc": "\n\n『后退按钮』的图形
\n可以通过 'image://url' 设置为图片,其中 URL 为图片的链接,或者 dataURI。
URL 为图片链接例如:
\n'image://http://xxx.xxx.xxx/a/b.png'\nURL 为 dataURI 例如:
'image://data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/XBs/fNwfjZ0frl3/zy7////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABAALAAAAAAQABAAAAVVICSOZGlCQAosJ6mu7fiyZeKqNKToQGDsM8hBADgUXoGAiqhSvp5QAnQKGIgUhwFUYLCVDFCrKUE1lBavAViFIDlTImbKC5Gm2hB0SlBCBMQiB0UjIQA7'\n可以通过 'path://' 将图标设置为任意的矢量路径。这种方式相比于使用图片的方式,不用担心因为缩放而产生锯齿或模糊,而且可以设置为任意颜色。路径图形会自适应调整为合适的大小。路径的格式参见 SVG PathData。可以从 Adobe Illustrator 等工具编辑导出。
例如:
\n'path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z'\n",
"uiControl": {
"type": "icon"
}
},
"controlStyle.nextIcon": {
"desc": "\n\n『前进按钮』的图形
\n可以通过 'image://url' 设置为图片,其中 URL 为图片的链接,或者 dataURI。
URL 为图片链接例如:
\n'image://http://xxx.xxx.xxx/a/b.png'\nURL 为 dataURI 例如:
'image://data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/XBs/fNwfjZ0frl3/zy7////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABAALAAAAAAQABAAAAVVICSOZGlCQAosJ6mu7fiyZeKqNKToQGDsM8hBADgUXoGAiqhSvp5QAnQKGIgUhwFUYLCVDFCrKUE1lBavAViFIDlTImbKC5Gm2hB0SlBCBMQiB0UjIQA7'\n可以通过 'path://' 将图标设置为任意的矢量路径。这种方式相比于使用图片的方式,不用担心因为缩放而产生锯齿或模糊,而且可以设置为任意颜色。路径图形会自适应调整为合适的大小。路径的格式参见 SVG PathData。可以从 Adobe Illustrator 等工具编辑导出。
例如:
\n'path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z'\n",
"uiControl": {
"type": "icon"
}
},
"controlStyle.color": {
"desc": "\n\n图形的颜色。
\n\n\n", "uiControl": { "type": "color" } }, "controlStyle.borderColor": { "desc": "\n\n颜色可以使用 RGB 表示,比如
\n'rgb(128, 128, 128)',如果想要加上 alpha 通道表示不透明度,可以使用 RGBA,比如'rgba(128, 128, 128, 0.5)',也可以使用十六进制格式,比如'#ccc'。除了纯色之外颜色也支持渐变色和纹理填充\n// 线性渐变,前四个参数分别是 x0, y0, x2, y2, 范围从 0 - 1,相当于在图形包围盒中的百分比,如果 globalCoord 为 `true`,则该四个值是绝对的像素位置\ncolor: {\n type: 'linear',\n x: 0,\n y: 0,\n x2: 0,\n y2: 1,\n colorStops: [{\n offset: 0, color: 'red' // 0% 处的颜色\n }, {\n offset: 1, color: 'blue' // 100% 处的颜色\n }],\n global: false // 缺省为 false\n}\n// 径向渐变,前三个参数分别是圆心 x, y 和半径,取值同线性渐变\ncolor: {\n type: 'radial',\n x: 0.5,\n y: 0.5,\n r: 0.5,\n colorStops: [{\n offset: 0, color: 'red' // 0% 处的颜色\n }, {\n offset: 1, color: 'blue' // 100% 处的颜色\n }],\n global: false // 缺省为 false\n}\n// 纹理填充\ncolor: {\n image: imageDom, // 支持为 HTMLImageElement, HTMLCanvasElement,不支持路径字符串\n repeat: 'repeat' // 是否平铺,可以是 'repeat-x', 'repeat-y', 'no-repeat'\n}\n
图形的描边颜色。支持的颜色格式同 color,不支持回调函数。
描边线宽。为 0 时无描边。
\n", "uiControl": { "type": "number", "value": "1", "min": "0", "step": "0.5" } }, "controlStyle.borderType": { "desc": "\n\n柱条的描边类型,默认为实线,支持 'solid', 'dashed', 'dotted'。
图形阴影的模糊大小。该属性配合 shadowColor,shadowOffsetX, shadowOffsetY 一起设置图形的阴影效果。
示例:
\n{\n shadowColor: 'rgba(0, 0, 0, 0.5)',\n shadowBlur: 10\n}\n\n",
"uiControl": {
"type": "number",
"default": "",
"min": "0",
"step": "0.5"
}
},
"controlStyle.shadowColor": {
"desc": "\n\n阴影颜色。支持的格式同color。
阴影水平方向上的偏移距离。
\n", "uiControl": { "type": "number", "default": "0", "step": "0.5" } }, "controlStyle.shadowOffsetY": { "desc": "\n\n阴影垂直方向上的偏移距离。
\n", "uiControl": { "type": "number", "default": "0", "step": "0.5" } }, "controlStyle.opacity": { "desc": "\n\n图形透明度。支持从 0 到 1 的数字,为 0 时不绘制该图形。
\n", "uiControl": { "type": "number", "default": "1", "min": "0", "max": "1", "step": "0.01" } }, "progress": { "desc": "进度条中的线条,拐点,标签的样式。
\n" }, "progress.lineStyle.color": { "desc": "\n\n线的颜色。
\n\n\n", "uiControl": { "type": "color" } }, "progress.lineStyle.width": { "desc": "\n\n颜色可以使用 RGB 表示,比如
\n'rgb(128, 128, 128)',如果想要加上 alpha 通道表示不透明度,可以使用 RGBA,比如'rgba(128, 128, 128, 0.5)',也可以使用十六进制格式,比如'#ccc'。除了纯色之外颜色也支持渐变色和纹理填充\n// 线性渐变,前四个参数分别是 x0, y0, x2, y2, 范围从 0 - 1,相当于在图形包围盒中的百分比,如果 globalCoord 为 `true`,则该四个值是绝对的像素位置\ncolor: {\n type: 'linear',\n x: 0,\n y: 0,\n x2: 0,\n y2: 1,\n colorStops: [{\n offset: 0, color: 'red' // 0% 处的颜色\n }, {\n offset: 1, color: 'blue' // 100% 处的颜色\n }],\n global: false // 缺省为 false\n}\n// 径向渐变,前三个参数分别是圆心 x, y 和半径,取值同线性渐变\ncolor: {\n type: 'radial',\n x: 0.5,\n y: 0.5,\n r: 0.5,\n colorStops: [{\n offset: 0, color: 'red' // 0% 处的颜色\n }, {\n offset: 1, color: 'blue' // 100% 处的颜色\n }],\n global: false // 缺省为 false\n}\n// 纹理填充\ncolor: {\n image: imageDom, // 支持为 HTMLImageElement, HTMLCanvasElement,不支持路径字符串\n repeat: 'repeat' // 是否平铺,可以是 'repeat-x', 'repeat-y', 'no-repeat'\n}\n
线宽。
\n", "uiControl": { "type": "number", "value": "1", "min": "0", "step": "0.5" } }, "progress.lineStyle.type": { "desc": "\n\n线的类型。
\n可选:
\n'solid''dashed''dotted'图形阴影的模糊大小。该属性配合 shadowColor,shadowOffsetX, shadowOffsetY 一起设置图形的阴影效果。
示例:
\n{\n shadowColor: 'rgba(0, 0, 0, 0.5)',\n shadowBlur: 10\n}\n\n",
"uiControl": {
"type": "number",
"default": "",
"min": "0",
"step": "0.5"
}
},
"progress.lineStyle.shadowColor": {
"desc": "\n\n阴影颜色。支持的格式同color。
阴影水平方向上的偏移距离。
\n", "uiControl": { "type": "number", "default": "0", "step": "0.5" } }, "progress.lineStyle.shadowOffsetY": { "desc": "\n\n阴影垂直方向上的偏移距离。
\n", "uiControl": { "type": "number", "default": "0", "step": "0.5" } }, "progress.lineStyle.opacity": { "desc": "\n\n图形透明度。支持从 0 到 1 的数字,为 0 时不绘制该图形。
\n", "uiControl": { "type": "number", "default": "1", "min": "0", "max": "1", "step": "0.01" } }, "progress.itemStyle.color": { "desc": "\n\n图形的颜色。
\n\n\n", "uiControl": { "type": "color" } }, "progress.itemStyle.borderColor": { "desc": "\n\n颜色可以使用 RGB 表示,比如
\n'rgb(128, 128, 128)',如果想要加上 alpha 通道表示不透明度,可以使用 RGBA,比如'rgba(128, 128, 128, 0.5)',也可以使用十六进制格式,比如'#ccc'。除了纯色之外颜色也支持渐变色和纹理填充\n// 线性渐变,前四个参数分别是 x0, y0, x2, y2, 范围从 0 - 1,相当于在图形包围盒中的百分比,如果 globalCoord 为 `true`,则该四个值是绝对的像素位置\ncolor: {\n type: 'linear',\n x: 0,\n y: 0,\n x2: 0,\n y2: 1,\n colorStops: [{\n offset: 0, color: 'red' // 0% 处的颜色\n }, {\n offset: 1, color: 'blue' // 100% 处的颜色\n }],\n global: false // 缺省为 false\n}\n// 径向渐变,前三个参数分别是圆心 x, y 和半径,取值同线性渐变\ncolor: {\n type: 'radial',\n x: 0.5,\n y: 0.5,\n r: 0.5,\n colorStops: [{\n offset: 0, color: 'red' // 0% 处的颜色\n }, {\n offset: 1, color: 'blue' // 100% 处的颜色\n }],\n global: false // 缺省为 false\n}\n// 纹理填充\ncolor: {\n image: imageDom, // 支持为 HTMLImageElement, HTMLCanvasElement,不支持路径字符串\n repeat: 'repeat' // 是否平铺,可以是 'repeat-x', 'repeat-y', 'no-repeat'\n}\n
图形的描边颜色。支持的颜色格式同 color,不支持回调函数。
描边线宽。为 0 时无描边。
\n", "uiControl": { "type": "number", "value": "0", "min": "0", "step": "0.5" } }, "progress.itemStyle.borderType": { "desc": "\n\n柱条的描边类型,默认为实线,支持 'solid', 'dashed', 'dotted'。
图形阴影的模糊大小。该属性配合 shadowColor,shadowOffsetX, shadowOffsetY 一起设置图形的阴影效果。
示例:
\n{\n shadowColor: 'rgba(0, 0, 0, 0.5)',\n shadowBlur: 10\n}\n\n",
"uiControl": {
"type": "number",
"default": "",
"min": "0",
"step": "0.5"
}
},
"progress.itemStyle.shadowColor": {
"desc": "\n\n阴影颜色。支持的格式同color。
阴影水平方向上的偏移距离。
\n", "uiControl": { "type": "number", "default": "0", "step": "0.5" } }, "progress.itemStyle.shadowOffsetY": { "desc": "\n\n阴影垂直方向上的偏移距离。
\n", "uiControl": { "type": "number", "default": "0", "step": "0.5" } }, "progress.itemStyle.opacity": { "desc": "\n\n图形透明度。支持从 0 到 1 的数字,为 0 时不绘制该图形。
\n", "uiControl": { "type": "number", "default": "1", "min": "0", "max": "1", "step": "0.01" } }, "progress.label.show": { "desc": "\n\n是否显示 label。
\n", "uiControl": { "type": "boolean", "default": "true" } }, "progress.label.interval": { "desc": "label 的间隔。当指定为数值时,例如指定为 2,则每隔两个显示一个 label。
label 的旋转角度。正值表示逆时针旋转。
刻度标签的内容格式器,支持字符串模板和回调函数两种形式。
\n示例:
\n// 使用字符串模板,模板变量为刻度默认标签 {value}\nformatter: '{value} kg'\n\n对于时间轴(type: 'time'),formatter 的字符串模板支持多种形式:
string 类型Function 类型object 类型下面我们分别介绍这三种形式。
\n字符串模板
\n使用字符串模板是一种方便实现常用日期时间格式化方式的形式。如果字符串模板可以实现你的效果,那我们优先推荐使用此方式;如果无法实现,再考虑其他两种更复杂的方式。支持的模板如下:
\n| 分类 | \n模板 | \n取值(英文) | \n取值(中文) | \n
|---|---|---|---|
| Year | \n{yyyy} | \ne.g., 2020, 2021, ... | \n例:2020, 2021, ... | \n
| \n | {yy} | \n00-99 | \n00-99 | \n
| Quarter | \n{Q} | \n1, 2, 3, 4 | \n1, 2, 3, 4 | \n
| Month | \n{MMMM} | \ne.g., January, February, ... | \n一月、二月、…… | \n
| \n | {MMM} | \ne.g., Jan, Feb, ... | \n1月、2月、…… | \n
| \n | {MM} | \n01-12 | \n01-12 | \n
| \n | {M} | \n1-12 | \n1-12 | \n
| Day of Month | \n{dd} | \n01-31 | \n01-31 | \n
| \n | {d} | \n1-31 | \n1-31 | \n
| Day of Week | \n{eeee} | \nSunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday | \n星期日、星期一、星期二、星期三、星期四、星期五、星期六 | \n
| \n | {ee} | \nSun, Mon, Tues, Wed, Thu, Fri, Sat | \n日、一、二、三、四、五、六 | \n
| \n | {e} | \n1-54 | \n1-54 | \n
| Hour | \n{HH} | \n00-23 | \n00-23 | \n
| \n | {H} | \n0-23 | \n0-23 | \n
| \n | {hh} | \n01-12 | \n01-12 | \n
| \n | {h} | \n1-12 | \n1-12 | \n
| Minute | \n{mm} | \n00-59 | \n00-59 | \n
| \n | {m} | \n0-59 | \n0-59 | \n
| Second | \n{ss} | \n00-59 | \n00-59 | \n
| \n | {s} | \n0-59 | \n0-59 | \n
| Millisecond | \n{SSS} | \n000-999 | \n000-999 | \n
| \n | {S} | \n0-999 | \n0-999 | \n
\n\n其他语言请参考相应语言包中的定义,语言包可以通过 echarts.registerLocale 注册。
\n
示例:
\nformatter: '{yyyy}-{MM}-{dd}' // 得到的 label 形如:'2020-12-02'\nformatter: '{d}日' // 得到的 label 形如:'2日'\n\n回调函数
\n回调函数可以根据刻度值返回不同的格式,如果有复杂的时间格式化需求,也可以引用第三方的日期时间相关的库(如 Moment.js、date-fns 等),返回显示的文本。
\n示例:
\n// 使用函数模板,函数参数分别为刻度数值(类目),刻度的索引\nformatter: function (value, index) {\n // 格式化成月/日,只在第一个刻度显示年份\n var date = new Date(value);\n var texts = [(date.getMonth() + 1), date.getDate()];\n if (index === 0) {\n texts.unshift(date.getYear());\n }\n return texts.join('/');\n}\n\n分级模板
\n有时候,我们希望对不同的时间粒度采用不同的格式化策略。例如,在季度图表中,我们可能希望对每个月的第一天显示月份,而其他日期显示日期。我们可以使用以下方式实现该效果:
\n示例:
\nformatter: {\n month: '{MMMM}', // 一月、二月、……\n day: '{d}日' // 1日、2日、……\n}\n\n支持的分级以及各自默认的取值为:
\n{\n year: '{yyyy}',\n month: '{MMM}',\n day: '{d}',\n hour: '{HH}:{mm}',\n minute: '{HH}:{mm}',\n second: '{HH}:{mm}:{ss}',\n millisecond: '{hh}:{mm}:{ss} {SSS}',\n none: '{yyyy}-{MM}-{dd} {hh}:{mm}:{ss} {SSS}'\n}\n\n以 day 为例,当一个刻度点的值的小时、分钟、秒、毫秒都为 0 时,将采用 day 的分级值作为模板。none 表示当其他规则都不适用时采用的模板,也就是带有毫秒值的刻度点的模板。
富文本
\n以上这三种形式的 formatter 都支持富文本,所以可以做成一些复杂的效果。
\n示例:
\nxAxis: {\n type: 'time',\n axisLabel: {\n formatter: {\n // 一年的第一个月显示年度信息和月份信息\n year: '{yearStyle|{yyyy}}\\n{monthStyle|{MMM}}',\n month: '{monthStyle|{MMM}}'\n },\n rich: {\n yearStyle: {\n // 让年度信息更醒目\n color: '#000',\n fontWeight: 'bold'\n },\n monthStyle: {\n color: '#999'\n }\n }\n }\n},\n\n使用回调函数形式实现上面例子同样的效果:
\n示例:
\nxAxis: {\n type: 'time',\n axisLabel: {\n formatter: function (value) {\n const date = new Date(value);\n const yearStart = new Date(value);\n yearStart.setMonth(0);\n yearStart.setDate(1);\n yearStart.setHours(0);\n yearStart.setMinutes(0);\n yearStart.setSeconds(0);\n yearStart.setMilliseconds(0);\n // 判断一个刻度值知否为一年的开始\n if (date.getTime() === yearStart.getTime()) {\n return '{year|' + date.getFullYear() + '}\\n'\n + '{month|' + (date.getMonth() + 1) + '月}';\n }\n else {\n return '{month|' + (date.getMonth() + 1) + '月}'\n }\n },\n rich: {\n year: {\n color: '#000',\n fontWeight: 'bold'\n },\n month: {\n color: '#999'\n }\n }\n }\n},\n\n"
},
"progress.label.color": {
"desc": "\n\ntimeline.lable文字的颜色。
\n", "uiControl": { "type": "color", "default": "'#6f778d'" } }, "progress.label.fontStyle": { "desc": "\n\ntimeline.lable文字字体的风格。
\n可选:
\n'normal''italic''oblique'timeline.lable文字字体的粗细。
\n可选:
\n'normal''bold''bolder''lighter'timeline.lable文字的字体系列。
\n还可以是 'serif' , 'monospace', 'Arial', 'Courier New', 'Microsoft YaHei', ...
\n", "uiControl": { "type": "enum", "default": "sans-serif", "options": "sans-serif,serif,monospace,Arial,Courier New" } }, "progress.label.fontSize": { "desc": "\n\ntimeline.lable文字的字体大小。
\n", "uiControl": { "type": "number", "default": "12", "min": "1", "step": "1" } }, "progress.label.align": { "desc": "\n\n文字水平对齐方式,默认自动。
\n可选:
\n'left''center''right'rich 中如果没有设置 align,则会取父层级的 align。例如:
{\n align: right,\n rich: {\n a: {\n // 没有设置 `align`,则 `align` 为 right\n }\n }\n}\n\n",
"uiControl": {
"type": "enum",
"options": "left,center,right"
}
},
"progress.label.verticalAlign": {
"desc": "\n\n文字垂直对齐方式,默认自动。
\n可选:
\n'top''middle''bottom'rich 中如果没有设置 verticalAlign,则会取父层级的 verticalAlign。例如:
{\n verticalAlign: bottom,\n rich: {\n a: {\n // 没有设置 `verticalAlign`,则 `verticalAlign` 为 bottom\n }\n }\n}\n\n",
"uiControl": {
"type": "enum",
"options": "top,middle,bottom"
}
},
"progress.label.lineHeight": {
"desc": "\n\n行高。
\nrich 中如果没有设置 lineHeight,则会取父层级的 lineHeight。例如:
{\n lineHeight: 56,\n rich: {\n a: {\n // 没有设置 `lineHeight`,则 `lineHeight` 为 56\n }\n }\n}\n\n",
"uiControl": {
"type": "number",
"min": "0",
"step": "1",
"default": "12"
}
},
"progress.label.backgroundColor": {
"desc": "\n\n文字块背景色。
\n可以使用颜色值,例如:'#123234', 'red', 'rgba(0,23,11,0.3)'。
也可以直接使用图片,例如:
\nbackgroundColor: {\n image: 'xxx/xxx.png'\n // 这里可以是图片的 URL,\n // 或者图片的 dataURI,\n // 或者 HTMLImageElement 对象,\n // 或者 HTMLCanvasElement 对象。\n}\n\n当使用图片的时候,可以使用 width 或 height 指定高宽,也可以不指定自适应。
文字块边框颜色。
\n", "uiControl": { "type": "color", "default": "#fff" } }, "progress.label.borderWidth": { "desc": "\n\n文字块边框宽度。
\n", "uiControl": { "type": "number", "min": "0", "step": "0.5" } }, "progress.label.borderRadius": { "desc": "\n\n文字块的圆角。
\n", "uiControl": { "type": "vector", "min": "0", "dims": "LT,RT, RB, LB" } }, "progress.label.padding": { "desc": "\n\n文字块的内边距。例如:
\npadding: [3, 4, 5, 6]:表示 [上, 右, 下, 左] 的边距。padding: 4:表示 padding: [4, 4, 4, 4]。padding: [3, 4]:表示 padding: [3, 4, 3, 4]。注意,文字块的 width 和 height 指定的是内容高宽,不包含 padding。
文字块的背景阴影颜色。
\n", "uiControl": { "type": "color" } }, "progress.label.shadowBlur": { "desc": "\n\n文字块的背景阴影长度。
\n", "uiControl": { "type": "number", "min": "0", "step": "0.5" } }, "progress.label.shadowOffsetX": { "desc": "\n\n文字块的背景阴影 X 偏移。
\n", "uiControl": { "type": "number", "step": "0.5" } }, "progress.label.shadowOffsetY": { "desc": "\n\n文字块的背景阴影 Y 偏移。
\n", "uiControl": { "type": "number", "step": "0.5" } }, "progress.label.width": { "desc": "\n\n文本显示宽度。
\n", "uiControl": { "type": "number", "default": "100", "min": "1", "max": "500", "step": "1" } }, "progress.label.height": { "desc": "\n\n文本显示高度。
\n", "uiControl": { "type": "number", "default": "50", "min": "1", "max": "500", "step": "1" } }, "progress.label.textBorderColor": { "desc": "\n\n文字本身的描边颜色。
\n", "uiControl": { "type": "color" } }, "progress.label.textBorderWidth": { "desc": "\n\n文字本身的描边宽度。
\n", "uiControl": { "type": "number", "min": "0", "step": "0.5" } }, "progress.label.textShadowColor": { "desc": "\n\n文字本身的阴影颜色。
\n", "uiControl": { "type": "color", "default": "#000" } }, "progress.label.textShadowBlur": { "desc": "\n\n文字本身的阴影长度。
\n", "uiControl": { "type": "number", "min": "0", "step": "0.5" } }, "progress.label.textShadowOffsetX": { "desc": "\n\n文字本身的阴影 X 偏移。
\n", "uiControl": { "type": "number", "step": "0.5" } }, "progress.label.textShadowOffsetY": { "desc": "\n\n文字本身的阴影 Y 偏移。
\n", "uiControl": { "type": "number", "step": "0.5" } }, "progress.label.overflow": { "desc": "\n\n文字超出宽度是否截断或者换行。配置width时有效
'truncate' 截断,并在末尾显示ellipsis配置的文本,默认为...'break' 换行'breakAll' 换行,跟'break'不同的是,在英语等拉丁文中,'breakAll'还会强制单词内换行在overflow配置为'truncate'的时候,可以通过该属性配置末尾显示的文本。
文本超出高度部分是否截断,配置height时有效。
'truncate' 在文本行数超出高度部分截断。在 rich 里面,可以自定义富文本样式。利用富文本样式,可以在标签中做出非常丰富的效果。
例如:
\nlabel: {\n // 在文本中,可以对部分文本采用 rich 中定义样式。\n // 这里需要在文本中使用标记符号:\n // `{styleName|text content text content}` 标记样式名。\n // 注意,换行仍是使用 '\\n'。\n formatter: [\n '{a|这段文本采用样式a}',\n '{b|这段文本采用样式b}这段用默认样式{x|这段用样式x}'\n ].join('\\n'),\n\n rich: {\n a: {\n color: 'red',\n lineHeight: 10\n },\n b: {\n backgroundColor: {\n image: 'xxx/xxx.jpg'\n },\n height: 40\n },\n x: {\n fontSize: 18,\n fontFamily: 'Microsoft YaHei',\n borderColor: '#449933',\n borderRadius: 4\n },\n ...\n }\n}\n\n详情参见教程:富文本标签
\n" }, "progress.label.rich.文字的颜色。
\n", "uiControl": { "type": "color", "default": "null" } }, "progress.label.rich.文字字体的风格。
\n可选:
\n'normal''italic''oblique'文字字体的粗细。
\n可选:
\n'normal''bold''bolder''lighter'文字的字体系列。
\n还可以是 'serif' , 'monospace', 'Arial', 'Courier New', 'Microsoft YaHei', ...
\n", "uiControl": { "type": "enum", "default": "sans-serif", "options": "sans-serif,serif,monospace,Arial,Courier New" } }, "progress.label.rich.文字的字体大小。
\n", "uiControl": { "type": "number", "default": "12", "min": "1", "step": "1" } }, "progress.label.rich.文字水平对齐方式,默认自动。
\n可选:
\n'left''center''right'rich 中如果没有设置 align,则会取父层级的 align。例如:
{\n align: right,\n rich: {\n a: {\n // 没有设置 `align`,则 `align` 为 right\n }\n }\n}\n\n",
"uiControl": {
"type": "enum",
"options": "left,center,right"
}
},
"progress.label.rich.文字垂直对齐方式,默认自动。
\n可选:
\n'top''middle''bottom'rich 中如果没有设置 verticalAlign,则会取父层级的 verticalAlign。例如:
{\n verticalAlign: bottom,\n rich: {\n a: {\n // 没有设置 `verticalAlign`,则 `verticalAlign` 为 bottom\n }\n }\n}\n\n",
"uiControl": {
"type": "enum",
"options": "top,middle,bottom"
}
},
"progress.label.rich.行高。
\nrich 中如果没有设置 lineHeight,则会取父层级的 lineHeight。例如:
{\n lineHeight: 56,\n rich: {\n a: {\n // 没有设置 `lineHeight`,则 `lineHeight` 为 56\n }\n }\n}\n\n",
"uiControl": {
"type": "number",
"min": "0",
"step": "1",
"default": "12"
}
},
"progress.label.rich.文字块背景色。
\n可以使用颜色值,例如:'#123234', 'red', 'rgba(0,23,11,0.3)'。
也可以直接使用图片,例如:
\nbackgroundColor: {\n image: 'xxx/xxx.png'\n // 这里可以是图片的 URL,\n // 或者图片的 dataURI,\n // 或者 HTMLImageElement 对象,\n // 或者 HTMLCanvasElement 对象。\n}\n\n当使用图片的时候,可以使用 width 或 height 指定高宽,也可以不指定自适应。
文字块边框颜色。
\n", "uiControl": { "type": "color", "default": "#fff" } }, "progress.label.rich.文字块边框宽度。
\n", "uiControl": { "type": "number", "min": "0", "step": "0.5" } }, "progress.label.rich.文字块的圆角。
\n", "uiControl": { "type": "vector", "min": "0", "dims": "LT,RT, RB, LB" } }, "progress.label.rich.文字块的内边距。例如:
\npadding: [3, 4, 5, 6]:表示 [上, 右, 下, 左] 的边距。padding: 4:表示 padding: [4, 4, 4, 4]。padding: [3, 4]:表示 padding: [3, 4, 3, 4]。注意,文字块的 width 和 height 指定的是内容高宽,不包含 padding。
文字块的背景阴影颜色。
\n", "uiControl": { "type": "color" } }, "progress.label.rich.文字块的背景阴影长度。
\n", "uiControl": { "type": "number", "min": "0", "step": "0.5" } }, "progress.label.rich.文字块的背景阴影 X 偏移。
\n", "uiControl": { "type": "number", "step": "0.5" } }, "progress.label.rich.文字块的背景阴影 Y 偏移。
\n", "uiControl": { "type": "number", "step": "0.5" } }, "progress.label.rich.文字块的宽度。一般不用指定,不指定则自动是文字的宽度。在想做表格项或者使用图片(参见 backgroundColor)时,可能会使用它。
注意,文字块的 width 和 height 指定的是内容高宽,不包含 padding。
width 也可以是百分比字符串,如 '100%'。表示的是所在文本块的 contentWidth(即不包含文本块的 padding)的百分之多少。之所以以 contentWidth 做基数,因为每个文本片段只能基于 content box 布局。如果以 outerWidth 做基数,则百分比的计算在实用中不具有意义,可能会超出。
注意,如果不定义 rich 属性,则不能指定 width 和 height。
文字块的高度。一般不用指定,不指定则自动是文字的高度。在使用图片(参见 backgroundColor)时,可能会使用它。
注意,文字块的 width 和 height 指定的是内容高宽,不包含 padding。
注意,如果不定义 rich 属性,则不能指定 width 和 height。
文字本身的描边颜色。
\n", "uiControl": { "type": "color" } }, "progress.label.rich.文字本身的描边宽度。
\n", "uiControl": { "type": "number", "min": "0", "step": "0.5" } }, "progress.label.rich.文字本身的阴影颜色。
\n", "uiControl": { "type": "color", "default": "#000" } }, "progress.label.rich.文字本身的阴影长度。
\n", "uiControl": { "type": "number", "min": "0", "step": "0.5" } }, "progress.label.rich.文字本身的阴影 X 偏移。
\n", "uiControl": { "type": "number", "step": "0.5" } }, "progress.label.rich.文字本身的阴影 Y 偏移。
\n", "uiControl": { "type": "number", "step": "0.5" } }, "emphasis.label.show": { "desc": "\n\n是否显示 label。
\n", "uiControl": { "type": "boolean", "default": "true" } }, "emphasis.label.interval": { "desc": "label 的间隔。当指定为数值时,例如指定为 2,则每隔两个显示一个 label。
label 的旋转角度。正值表示逆时针旋转。
刻度标签的内容格式器,支持字符串模板和回调函数两种形式。
\n示例:
\n// 使用字符串模板,模板变量为刻度默认标签 {value}\nformatter: '{value} kg'\n\n对于时间轴(type: 'time'),formatter 的字符串模板支持多种形式:
string 类型Function 类型object 类型下面我们分别介绍这三种形式。
\n字符串模板
\n使用字符串模板是一种方便实现常用日期时间格式化方式的形式。如果字符串模板可以实现你的效果,那我们优先推荐使用此方式;如果无法实现,再考虑其他两种更复杂的方式。支持的模板如下:
\n| 分类 | \n模板 | \n取值(英文) | \n取值(中文) | \n
|---|---|---|---|
| Year | \n{yyyy} | \ne.g., 2020, 2021, ... | \n例:2020, 2021, ... | \n
| \n | {yy} | \n00-99 | \n00-99 | \n
| Quarter | \n{Q} | \n1, 2, 3, 4 | \n1, 2, 3, 4 | \n
| Month | \n{MMMM} | \ne.g., January, February, ... | \n一月、二月、…… | \n
| \n | {MMM} | \ne.g., Jan, Feb, ... | \n1月、2月、…… | \n
| \n | {MM} | \n01-12 | \n01-12 | \n
| \n | {M} | \n1-12 | \n1-12 | \n
| Day of Month | \n{dd} | \n01-31 | \n01-31 | \n
| \n | {d} | \n1-31 | \n1-31 | \n
| Day of Week | \n{eeee} | \nSunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday | \n星期日、星期一、星期二、星期三、星期四、星期五、星期六 | \n
| \n | {ee} | \nSun, Mon, Tues, Wed, Thu, Fri, Sat | \n日、一、二、三、四、五、六 | \n
| \n | {e} | \n1-54 | \n1-54 | \n
| Hour | \n{HH} | \n00-23 | \n00-23 | \n
| \n | {H} | \n0-23 | \n0-23 | \n
| \n | {hh} | \n01-12 | \n01-12 | \n
| \n | {h} | \n1-12 | \n1-12 | \n
| Minute | \n{mm} | \n00-59 | \n00-59 | \n
| \n | {m} | \n0-59 | \n0-59 | \n
| Second | \n{ss} | \n00-59 | \n00-59 | \n
| \n | {s} | \n0-59 | \n0-59 | \n
| Millisecond | \n{SSS} | \n000-999 | \n000-999 | \n
| \n | {S} | \n0-999 | \n0-999 | \n
\n\n其他语言请参考相应语言包中的定义,语言包可以通过 echarts.registerLocale 注册。
\n
示例:
\nformatter: '{yyyy}-{MM}-{dd}' // 得到的 label 形如:'2020-12-02'\nformatter: '{d}日' // 得到的 label 形如:'2日'\n\n回调函数
\n回调函数可以根据刻度值返回不同的格式,如果有复杂的时间格式化需求,也可以引用第三方的日期时间相关的库(如 Moment.js、date-fns 等),返回显示的文本。
\n示例:
\n// 使用函数模板,函数参数分别为刻度数值(类目),刻度的索引\nformatter: function (value, index) {\n // 格式化成月/日,只在第一个刻度显示年份\n var date = new Date(value);\n var texts = [(date.getMonth() + 1), date.getDate()];\n if (index === 0) {\n texts.unshift(date.getYear());\n }\n return texts.join('/');\n}\n\n分级模板
\n有时候,我们希望对不同的时间粒度采用不同的格式化策略。例如,在季度图表中,我们可能希望对每个月的第一天显示月份,而其他日期显示日期。我们可以使用以下方式实现该效果:
\n示例:
\nformatter: {\n month: '{MMMM}', // 一月、二月、……\n day: '{d}日' // 1日、2日、……\n}\n\n支持的分级以及各自默认的取值为:
\n{\n year: '{yyyy}',\n month: '{MMM}',\n day: '{d}',\n hour: '{HH}:{mm}',\n minute: '{HH}:{mm}',\n second: '{HH}:{mm}:{ss}',\n millisecond: '{hh}:{mm}:{ss} {SSS}',\n none: '{yyyy}-{MM}-{dd} {hh}:{mm}:{ss} {SSS}'\n}\n\n以 day 为例,当一个刻度点的值的小时、分钟、秒、毫秒都为 0 时,将采用 day 的分级值作为模板。none 表示当其他规则都不适用时采用的模板,也就是带有毫秒值的刻度点的模板。
富文本
\n以上这三种形式的 formatter 都支持富文本,所以可以做成一些复杂的效果。
\n示例:
\nxAxis: {\n type: 'time',\n axisLabel: {\n formatter: {\n // 一年的第一个月显示年度信息和月份信息\n year: '{yearStyle|{yyyy}}\\n{monthStyle|{MMM}}',\n month: '{monthStyle|{MMM}}'\n },\n rich: {\n yearStyle: {\n // 让年度信息更醒目\n color: '#000',\n fontWeight: 'bold'\n },\n monthStyle: {\n color: '#999'\n }\n }\n }\n},\n\n使用回调函数形式实现上面例子同样的效果:
\n示例:
\nxAxis: {\n type: 'time',\n axisLabel: {\n formatter: function (value) {\n const date = new Date(value);\n const yearStart = new Date(value);\n yearStart.setMonth(0);\n yearStart.setDate(1);\n yearStart.setHours(0);\n yearStart.setMinutes(0);\n yearStart.setSeconds(0);\n yearStart.setMilliseconds(0);\n // 判断一个刻度值知否为一年的开始\n if (date.getTime() === yearStart.getTime()) {\n return '{year|' + date.getFullYear() + '}\\n'\n + '{month|' + (date.getMonth() + 1) + '月}';\n }\n else {\n return '{month|' + (date.getMonth() + 1) + '月}'\n }\n },\n rich: {\n year: {\n color: '#000',\n fontWeight: 'bold'\n },\n month: {\n color: '#999'\n }\n }\n }\n},\n\n"
},
"emphasis.label.color": {
"desc": "\n\ntimeline.lable.emphasis文字的颜色。
\n", "uiControl": { "type": "color", "default": "'#6f778d'" } }, "emphasis.label.fontStyle": { "desc": "\n\ntimeline.lable.emphasis文字字体的风格。
\n可选:
\n'normal''italic''oblique'timeline.lable.emphasis文字字体的粗细。
\n可选:
\n'normal''bold''bolder''lighter'timeline.lable.emphasis文字的字体系列。
\n还可以是 'serif' , 'monospace', 'Arial', 'Courier New', 'Microsoft YaHei', ...
\n", "uiControl": { "type": "enum", "default": "sans-serif", "options": "sans-serif,serif,monospace,Arial,Courier New" } }, "emphasis.label.fontSize": { "desc": "\n\ntimeline.lable.emphasis文字的字体大小。
\n", "uiControl": { "type": "number", "default": "12", "min": "1", "step": "1" } }, "emphasis.label.align": { "desc": "\n\n文字水平对齐方式,默认自动。
\n可选:
\n'left''center''right'rich 中如果没有设置 align,则会取父层级的 align。例如:
{\n align: right,\n rich: {\n a: {\n // 没有设置 `align`,则 `align` 为 right\n }\n }\n}\n\n",
"uiControl": {
"type": "enum",
"options": "left,center,right"
}
},
"emphasis.label.verticalAlign": {
"desc": "\n\n文字垂直对齐方式,默认自动。
\n可选:
\n'top''middle''bottom'rich 中如果没有设置 verticalAlign,则会取父层级的 verticalAlign。例如:
{\n verticalAlign: bottom,\n rich: {\n a: {\n // 没有设置 `verticalAlign`,则 `verticalAlign` 为 bottom\n }\n }\n}\n\n",
"uiControl": {
"type": "enum",
"options": "top,middle,bottom"
}
},
"emphasis.label.lineHeight": {
"desc": "\n\n行高。
\nrich 中如果没有设置 lineHeight,则会取父层级的 lineHeight。例如:
{\n lineHeight: 56,\n rich: {\n a: {\n // 没有设置 `lineHeight`,则 `lineHeight` 为 56\n }\n }\n}\n\n",
"uiControl": {
"type": "number",
"min": "0",
"step": "1",
"default": "12"
}
},
"emphasis.label.backgroundColor": {
"desc": "\n\n文字块背景色。
\n可以使用颜色值,例如:'#123234', 'red', 'rgba(0,23,11,0.3)'。
也可以直接使用图片,例如:
\nbackgroundColor: {\n image: 'xxx/xxx.png'\n // 这里可以是图片的 URL,\n // 或者图片的 dataURI,\n // 或者 HTMLImageElement 对象,\n // 或者 HTMLCanvasElement 对象。\n}\n\n当使用图片的时候,可以使用 width 或 height 指定高宽,也可以不指定自适应。
文字块边框颜色。
\n", "uiControl": { "type": "color", "default": "#fff" } }, "emphasis.label.borderWidth": { "desc": "\n\n文字块边框宽度。
\n", "uiControl": { "type": "number", "min": "0", "step": "0.5" } }, "emphasis.label.borderRadius": { "desc": "\n\n文字块的圆角。
\n", "uiControl": { "type": "vector", "min": "0", "dims": "LT,RT, RB, LB" } }, "emphasis.label.padding": { "desc": "\n\n文字块的内边距。例如:
\npadding: [3, 4, 5, 6]:表示 [上, 右, 下, 左] 的边距。padding: 4:表示 padding: [4, 4, 4, 4]。padding: [3, 4]:表示 padding: [3, 4, 3, 4]。注意,文字块的 width 和 height 指定的是内容高宽,不包含 padding。
文字块的背景阴影颜色。
\n", "uiControl": { "type": "color" } }, "emphasis.label.shadowBlur": { "desc": "\n\n文字块的背景阴影长度。
\n", "uiControl": { "type": "number", "min": "0", "step": "0.5" } }, "emphasis.label.shadowOffsetX": { "desc": "\n\n文字块的背景阴影 X 偏移。
\n", "uiControl": { "type": "number", "step": "0.5" } }, "emphasis.label.shadowOffsetY": { "desc": "\n\n文字块的背景阴影 Y 偏移。
\n", "uiControl": { "type": "number", "step": "0.5" } }, "emphasis.label.width": { "desc": "\n\n文本显示宽度。
\n", "uiControl": { "type": "number", "default": "100", "min": "1", "max": "500", "step": "1" } }, "emphasis.label.height": { "desc": "\n\n文本显示高度。
\n", "uiControl": { "type": "number", "default": "50", "min": "1", "max": "500", "step": "1" } }, "emphasis.label.textBorderColor": { "desc": "\n\n文字本身的描边颜色。
\n", "uiControl": { "type": "color" } }, "emphasis.label.textBorderWidth": { "desc": "\n\n文字本身的描边宽度。
\n", "uiControl": { "type": "number", "min": "0", "step": "0.5" } }, "emphasis.label.textShadowColor": { "desc": "\n\n文字本身的阴影颜色。
\n", "uiControl": { "type": "color", "default": "#000" } }, "emphasis.label.textShadowBlur": { "desc": "\n\n文字本身的阴影长度。
\n", "uiControl": { "type": "number", "min": "0", "step": "0.5" } }, "emphasis.label.textShadowOffsetX": { "desc": "\n\n文字本身的阴影 X 偏移。
\n", "uiControl": { "type": "number", "step": "0.5" } }, "emphasis.label.textShadowOffsetY": { "desc": "\n\n文字本身的阴影 Y 偏移。
\n", "uiControl": { "type": "number", "step": "0.5" } }, "emphasis.label.overflow": { "desc": "\n\n文字超出宽度是否截断或者换行。配置width时有效
'truncate' 截断,并在末尾显示ellipsis配置的文本,默认为...'break' 换行'breakAll' 换行,跟'break'不同的是,在英语等拉丁文中,'breakAll'还会强制单词内换行在overflow配置为'truncate'的时候,可以通过该属性配置末尾显示的文本。
文本超出高度部分是否截断,配置height时有效。
'truncate' 在文本行数超出高度部分截断。在 rich 里面,可以自定义富文本样式。利用富文本样式,可以在标签中做出非常丰富的效果。
例如:
\nlabel: {\n // 在文本中,可以对部分文本采用 rich 中定义样式。\n // 这里需要在文本中使用标记符号:\n // `{styleName|text content text content}` 标记样式名。\n // 注意,换行仍是使用 '\\n'。\n formatter: [\n '{a|这段文本采用样式a}',\n '{b|这段文本采用样式b}这段用默认样式{x|这段用样式x}'\n ].join('\\n'),\n\n rich: {\n a: {\n color: 'red',\n lineHeight: 10\n },\n b: {\n backgroundColor: {\n image: 'xxx/xxx.jpg'\n },\n height: 40\n },\n x: {\n fontSize: 18,\n fontFamily: 'Microsoft YaHei',\n borderColor: '#449933',\n borderRadius: 4\n },\n ...\n }\n}\n\n详情参见教程:富文本标签
\n" }, "emphasis.label.rich.文字的颜色。
\n", "uiControl": { "type": "color", "default": "null" } }, "emphasis.label.rich.文字字体的风格。
\n可选:
\n'normal''italic''oblique'文字字体的粗细。
\n可选:
\n'normal''bold''bolder''lighter'文字的字体系列。
\n还可以是 'serif' , 'monospace', 'Arial', 'Courier New', 'Microsoft YaHei', ...
\n", "uiControl": { "type": "enum", "default": "sans-serif", "options": "sans-serif,serif,monospace,Arial,Courier New" } }, "emphasis.label.rich.文字的字体大小。
\n", "uiControl": { "type": "number", "default": "12", "min": "1", "step": "1" } }, "emphasis.label.rich.文字水平对齐方式,默认自动。
\n可选:
\n'left''center''right'rich 中如果没有设置 align,则会取父层级的 align。例如:
{\n align: right,\n rich: {\n a: {\n // 没有设置 `align`,则 `align` 为 right\n }\n }\n}\n\n",
"uiControl": {
"type": "enum",
"options": "left,center,right"
}
},
"emphasis.label.rich.文字垂直对齐方式,默认自动。
\n可选:
\n'top''middle''bottom'rich 中如果没有设置 verticalAlign,则会取父层级的 verticalAlign。例如:
{\n verticalAlign: bottom,\n rich: {\n a: {\n // 没有设置 `verticalAlign`,则 `verticalAlign` 为 bottom\n }\n }\n}\n\n",
"uiControl": {
"type": "enum",
"options": "top,middle,bottom"
}
},
"emphasis.label.rich.行高。
\nrich 中如果没有设置 lineHeight,则会取父层级的 lineHeight。例如:
{\n lineHeight: 56,\n rich: {\n a: {\n // 没有设置 `lineHeight`,则 `lineHeight` 为 56\n }\n }\n}\n\n",
"uiControl": {
"type": "number",
"min": "0",
"step": "1",
"default": "12"
}
},
"emphasis.label.rich.文字块背景色。
\n可以使用颜色值,例如:'#123234', 'red', 'rgba(0,23,11,0.3)'。
也可以直接使用图片,例如:
\nbackgroundColor: {\n image: 'xxx/xxx.png'\n // 这里可以是图片的 URL,\n // 或者图片的 dataURI,\n // 或者 HTMLImageElement 对象,\n // 或者 HTMLCanvasElement 对象。\n}\n\n当使用图片的时候,可以使用 width 或 height 指定高宽,也可以不指定自适应。
文字块边框颜色。
\n", "uiControl": { "type": "color", "default": "#fff" } }, "emphasis.label.rich.文字块边框宽度。
\n", "uiControl": { "type": "number", "min": "0", "step": "0.5" } }, "emphasis.label.rich.文字块的圆角。
\n", "uiControl": { "type": "vector", "min": "0", "dims": "LT,RT, RB, LB" } }, "emphasis.label.rich.文字块的内边距。例如:
\npadding: [3, 4, 5, 6]:表示 [上, 右, 下, 左] 的边距。padding: 4:表示 padding: [4, 4, 4, 4]。padding: [3, 4]:表示 padding: [3, 4, 3, 4]。注意,文字块的 width 和 height 指定的是内容高宽,不包含 padding。
文字块的背景阴影颜色。
\n", "uiControl": { "type": "color" } }, "emphasis.label.rich.文字块的背景阴影长度。
\n", "uiControl": { "type": "number", "min": "0", "step": "0.5" } }, "emphasis.label.rich.文字块的背景阴影 X 偏移。
\n", "uiControl": { "type": "number", "step": "0.5" } }, "emphasis.label.rich.文字块的背景阴影 Y 偏移。
\n", "uiControl": { "type": "number", "step": "0.5" } }, "emphasis.label.rich.文字块的宽度。一般不用指定,不指定则自动是文字的宽度。在想做表格项或者使用图片(参见 backgroundColor)时,可能会使用它。
注意,文字块的 width 和 height 指定的是内容高宽,不包含 padding。
width 也可以是百分比字符串,如 '100%'。表示的是所在文本块的 contentWidth(即不包含文本块的 padding)的百分之多少。之所以以 contentWidth 做基数,因为每个文本片段只能基于 content box 布局。如果以 outerWidth 做基数,则百分比的计算在实用中不具有意义,可能会超出。
注意,如果不定义 rich 属性,则不能指定 width 和 height。
文字块的高度。一般不用指定,不指定则自动是文字的高度。在使用图片(参见 backgroundColor)时,可能会使用它。
注意,文字块的 width 和 height 指定的是内容高宽,不包含 padding。
注意,如果不定义 rich 属性,则不能指定 width 和 height。
文字本身的描边颜色。
\n", "uiControl": { "type": "color" } }, "emphasis.label.rich.文字本身的描边宽度。
\n", "uiControl": { "type": "number", "min": "0", "step": "0.5" } }, "emphasis.label.rich.文字本身的阴影颜色。
\n", "uiControl": { "type": "color", "default": "#000" } }, "emphasis.label.rich.文字本身的阴影长度。
\n", "uiControl": { "type": "number", "min": "0", "step": "0.5" } }, "emphasis.label.rich.文字本身的阴影 X 偏移。
\n", "uiControl": { "type": "number", "step": "0.5" } }, "emphasis.label.rich.文字本身的阴影 Y 偏移。
\n", "uiControl": { "type": "number", "step": "0.5" } }, "emphasis.itemStyle.color": { "desc": "\n\ntimeline 图形的颜色。
\n\n\n", "uiControl": { "type": "color" } }, "emphasis.itemStyle.borderColor": { "desc": "\n\n颜色可以使用 RGB 表示,比如
\n'rgb(128, 128, 128)',如果想要加上 alpha 通道表示不透明度,可以使用 RGBA,比如'rgba(128, 128, 128, 0.5)',也可以使用十六进制格式,比如'#ccc'。除了纯色之外颜色也支持渐变色和纹理填充\n// 线性渐变,前四个参数分别是 x0, y0, x2, y2, 范围从 0 - 1,相当于在图形包围盒中的百分比,如果 globalCoord 为 `true`,则该四个值是绝对的像素位置\ncolor: {\n type: 'linear',\n x: 0,\n y: 0,\n x2: 0,\n y2: 1,\n colorStops: [{\n offset: 0, color: 'red' // 0% 处的颜色\n }, {\n offset: 1, color: 'blue' // 100% 处的颜色\n }],\n global: false // 缺省为 false\n}\n// 径向渐变,前三个参数分别是圆心 x, y 和半径,取值同线性渐变\ncolor: {\n type: 'radial',\n x: 0.5,\n y: 0.5,\n r: 0.5,\n colorStops: [{\n offset: 0, color: 'red' // 0% 处的颜色\n }, {\n offset: 1, color: 'blue' // 100% 处的颜色\n }],\n global: false // 缺省为 false\n}\n// 纹理填充\ncolor: {\n image: imageDom, // 支持为 HTMLImageElement, HTMLCanvasElement,不支持路径字符串\n repeat: 'repeat' // 是否平铺,可以是 'repeat-x', 'repeat-y', 'no-repeat'\n}\n
timeline 图形的描边颜色。支持的颜色格式同 color,不支持回调函数。
timeline 描边线宽。为 0 时无描边。
\n", "uiControl": { "type": "number", "value": "1", "min": "0", "step": "0.5" } }, "emphasis.itemStyle.borderType": { "desc": "\n\n柱条的描边类型,默认为实线,支持 'solid', 'dashed', 'dotted'。
图形阴影的模糊大小。该属性配合 shadowColor,shadowOffsetX, shadowOffsetY 一起设置图形的阴影效果。
示例:
\n{\n shadowColor: 'rgba(0, 0, 0, 0.5)',\n shadowBlur: 10\n}\n\n",
"uiControl": {
"type": "number",
"default": "",
"min": "0",
"step": "0.5"
}
},
"emphasis.itemStyle.shadowColor": {
"desc": "\n\n阴影颜色。支持的格式同color。
阴影水平方向上的偏移距离。
\n", "uiControl": { "type": "number", "default": "0", "step": "0.5" } }, "emphasis.itemStyle.shadowOffsetY": { "desc": "\n\n阴影垂直方向上的偏移距离。
\n", "uiControl": { "type": "number", "default": "0", "step": "0.5" } }, "emphasis.itemStyle.opacity": { "desc": "\n\n图形透明度。支持从 0 到 1 的数字,为 0 时不绘制该图形。
\n", "uiControl": { "type": "number", "default": "1", "min": "0", "max": "1", "step": "0.01" } }, "emphasis.checkpointStyle": { "desc": "当前项『高亮状态』的样式(hover时)。
\n" }, "emphasis.controlStyle": { "desc": "控制按钮的『高亮状态』的样式(hover时)。
\n" }, "data": { "desc": "timeline 数据。Array 的每一项,可以是直接的数值。\n如果需要对每个数据项单独进行样式定义,则数据项写成 Object。Object中,value属性为数值。其他属性如下例子,可以覆盖 timeline 中的属性配置。
如下例:
\n[\n '2002-01-01',\n '2003-01-01',\n '2004-01-01',\n {\n value: '2005-01-01',\n tooltip: { // 让鼠标悬浮到此项时能够显示 `tooltip`。\n formatter: '{b} xxxx'\n },\n symbol: 'diamond', // 此项的图形的特别设置。\n symbolSize: 16 // 此项的图形大小的特别设置。\n },\n '2006-01-01',\n '2007-01-01',\n '2008-01-01',\n '2009-01-01',\n '2010-01-01',\n {\n value: '2011-01-01',\n tooltip: { // 让鼠标悬浮到此项时能够显示 `tooltip`。\n formatter: function (params) {\n return params.name + 'xxxx';\n }\n },\n symbol: 'diamond',\n symbolSize: 18\n },\n]\n\n"
}
}