以横轴为例
demo | xAxis |
---|
show | true false |
name | 坐标轴名字 |
nameLocation | 坐标轴位置 |
property | nameStyle |
坐标轴名称样式
nameStyle{
color: ..., 设置x轴的name的样式
fontStyle: 'normal',
fontWeight: normal,
fontFamily: 'sans-serif',
fontSize: 12,
align: ..., 水平对齐方式
verticalAlign: ..., 垂直对齐方式
lineHeight: ..., 行高
backgroundColor: 'transparent',
borderColor: 'transparent',
borderWidth: 0, 边框宽度
borderRadius: 0, 边框圆角
padding: 0, 内边距
shadowColor: 'transparent', 阴影颜色
shadowBlur: 0, 阴影模糊范围
shadowOffsetX: 0, X偏移
shadowOffsetY: 0, Y偏移
width: ...,
height: ...,
textBorderColor: 'transparent', 文本边框颜色
textBorderWidth: 0, 文本边框宽度
textShadowColor: 'transparent', 文本阴影颜色
textShadowBlur: 0, 文本阴影模糊范围
textShadowOffsetX: 0, 文本阴影X偏移
textShadowOffsetY: 0,文本阴影Y偏移
..},
nameGap: 15 | 坐标轴名称与轴线之间的距离。 |
---|
nameRotate: null, | 旋转角度 |
property | axisLine |
坐标轴线设置
axisLine {
show: true, 是否显示坐标轴轴线。
onZero: true,
onZeroAxisIndex: ...,
symbol: 'none', 只在末端显示箭头可以设置为 ['none', 'arrow']。
symbolSize: [10, 15], 轴线两边的箭头的大小,第一个数字表示宽度(垂直坐标轴方向),第二个数字表示高度(平行坐标轴方向)。
symbolOffset: [0, 0] 轴线两边的箭头的偏移,如果是数组,第一个数字表示起始箭头的偏移,第二个数字表示末端箭头的偏移;如果是数字,表示这两个箭头使用同样的偏移。
lineStyle{
color: '#333',
width: 1,
type: 'solid', 实线
shadowBlur: ..., 阴影模糊范围
shadowColor: ...,阴影颜色
shadowOffsetX: 0, X偏移
shadowOffsetY: 0,Y偏移
opacity: ...,透明度
坐标轴刻度相关设置。
axisTick: {..
show: true, 是否显示坐标轴刻度。
alignWithLabel: false, 类目轴中在 boundaryGap 为 true 的时候有效,可以保证刻度线和标签对齐。如下图:
interval: 'auto',
inside: false, 坐标轴刻度是否朝内,默认朝外。
length: 5, 坐标轴刻度的长度。
lineStyle{
color: ...,
width: 1,
type: 'solid',
shadowBlur: ...,
shadowColor: ...,
shadowOffsetX: 0,
shadowOffsetY: 0,
opacity: ...,
.},
坐标轴刻度标签的相关设置。
axisLabel: {..
.},
splitLine: {
show: true,
interval: 'auto',
分隔线设置
lineStyle: {..
color: ['#ccc'],
width: 1,
type: 'solid',
shadowBlur: ...,
shadowColor: ...,
shadowOffsetX: 0,
shadowOffsetY: 0,
opacity: ...,
.},
splitArea: {.
interval: 'auto',
show: false,
分割区设置
areaStyle: {.
color: ['rgba(250,250,250,0...,
shadowBlur: ...,
shadowColor: ...,
shadowOffsetX: 0,
shadowOffsetY: 0,
opacity: ...,
..},
data: [{..
value: ..单个类目名称.,
数据部分文本样式
textStyle: {.
color: '#fff',
fontStyle: 'normal',
fontWeight: normal,
fontFamily: 'sans-serif',
fontSize: 12,
align: ...,
verticalAlign: ...,
lineHeight: ...,
backgroundColor: 'transparent',
borderColor: 'transparent',
borderWidth: 0,
borderRadius: 0,
padding: 0,
shadowColor: 'transparent',
shadowBlur: 0,
shadowOffsetX: 0,
shadowOffsetY: 0,
width: ...,
height: ...,
textBorderColor: 'transparent',
textBorderWidth: 0,
textShadowColor: 'transparent',
textShadowBlur: 0,
textShadowOffsetX: 0,
textShadowOffsetY: 0,
..},
.}],