echarts修改X Y坐标轴字体的颜色

Posted yun1108

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了echarts修改X Y坐标轴字体的颜色相关的知识,希望对你有一定的参考价值。

1、背景:在项目中常常会用到echarts的实例,根据不同的需求字体颜色需要变化,如图,要切合背景,就需要更改字体颜色

技术分享图片

2、解决方案

 

xAxis : [
            {
              type : ‘category‘,
              data : weekDay,
              axisLabel: {
                show: true,
                textStyle: {
                  color: this.xFontColor   //这里用参数代替了
                }
              },
            }
          ],
          yAxis : [
            {
              type : ‘value‘,
              splitLine:{
                show:false
              },
              //  去掉背景的网格线
              axisLabel: {
                show: true,
                textStyle: {
                  color:this.yFontColor  //这里用参数代替了
                }
              },
            }
          ],

 

以上是关于echarts修改X Y坐标轴字体的颜色的主要内容,如果未能解决你的问题,请参考以下文章