ECharts径向轴轴线属性与样式

2018-09-14 09:42 更新

radiusAxis.axisLine    |   Object

极坐标系径向轴轴线的相关设置。

radiusAxis.axisLine.show   |   boolean

[ default: true ]

是否显示径向轴轴线。默认为显示,您可以设置其为 false,则不显示。

radiusAxis.axisLine.lineStyle   |   Object

极坐标系径向轴轴线样式的相关设置。

radiusAxis.axisLine.lineStyle.color   |   Color

[ default: '#333' ]

径向轴轴线的颜色。

颜色可以使用 RGB 表示,比如 'rgb(128, 128, 128)',如果想要加上 alpha 通道表示不透明度,可以使用 RGBA,比如 'rgba(128, 128, 128, 0.5)',也可以使用十六进制格式,比如 '#ccc'。除了纯色之外颜色也支持渐变色和纹理填充
// 线性渐变,前四个参数分别是 x0, y0, x2, y2, 范围从 0 - 1,相当于在图形包围盒中的百分比,如果 globalCoord 为 `true`,则该四个值是绝对的像素位置
color: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [{
offset: 0, color: 'red' // 0% 处的颜色
}, {
offset: 1, color: 'blue' // 100% 处的颜色
}],
globalCoord: false // 缺省为 false
}
// 径向渐变,前三个参数分别是圆心 x, y 和半径,取值同线性渐变
color: {
type: 'radial',
x: 0.5,
y: 0.5,
r: 0.5,
colorStops: [{
offset: 0, color: 'red' // 0% 处的颜色
}, {
offset: 1, color: 'blue' // 100% 处的颜色
}],
globalCoord: false // 缺省为 false
}
// 纹理填充
color: {
image: imageDom, // 支持为 HTMLImageElement, HTMLCanvasElement,不支持路径字符串
repeat: 'repeat' // 是否平铺, 可以是 'repeat-x', 'repeat-y', 'no-repeat'
}

radiusAxis.axisLine.lineStyle.width   |   number

[ default: 1 ]

径向轴轴线的线宽。

radiusAxis.axisLine.lineStyle.type   |   string

[ default: 'solid' ]

径向轴轴线的类型。

可选:

  • 'solid'
  • 'dashed'
  • 'dotted'

radiusAxis.axisLine.lineStyle.shadowBlur   |   number

径向轴轴线图形阴影的模糊大小。该属性配合 shadowColor,shadowOffsetX, shadowOffsetY 一起设置图形的阴影效果。

示例:

{
shadowColor: 'rgba(0, 0, 0, 0.5)',
shadowBlur: 10
}

radiusAxis.axisLine.lineStyle.shadowColor   |   Color

径向轴轴线阴影的颜色。支持的格式同color。

radiusAxis.axisLine.lineStyle.shadowOffsetX   |   number

[ default: 0 ]

径向轴轴线阴影在水平方向上的偏移距离。

radiusAxis.axisLine.lineStyle.shadowOffsetY   |   number

[ default: 0 ]

径向轴轴线阴影在垂直方向上的偏移距离。

radiusAxis.axisLine.lineStyle.opacity   |   number

径向轴轴线的图形透明度。

支持从 0 到 1 的数字,为 0 时不绘制该图形。
以上内容是否对您有帮助:
在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号