> 文章列表 > echarts 刻度线

echarts 刻度线

echarts 刻度线

echarts 刻度线
解决:

    yAxis: [{type: 'value',name: '',position: 'left',boundaryGap: false,axisTick: { //  刻度线show: false,   },}],

注意:
1、boundaryGap

默认值:true。 参数类型:boolean,Array。
可选值:
(1)true,x坐标轴两边留白。
(2)false,x坐标轴两边不留白。
(3)[‘30%’, ‘20%’]。

2、axisTick 刻度线样式

 boundaryGap: true,axisTick: { // X/y轴线 刻度线show: true,length: 4,lineStyle: {color:'red',type: 'solid',width: 1},alignWithLabel: true //在设置boundaryGap 为 true的前提下,设置alignWithLabel使刻度线和标签对齐},
 yAxis: [{type: 'value',name: '',position: 'left',boundaryGap: true, axisTick: { // 刻度线show: false,length: 4,lineStyle: {color:'red',type: 'solid',width: 1},alignWithLabel: true },axisLine: { //坐标轴show: false,lineStyle: {color: colors[0]}},axisLabel: { //轴文字interval: 0, //坐标轴文字(或数字)与坐标轴的距离rotate: 0, //旋转文字formatter: '{value}' // 带单位的话 formatter: '{value} °C' },splitLine: { //背景线条show: true, lineStyle: {color: colors[1], type: "solid" //默认是实线,dashed是虚线}}}]