echart 如何修改折线图的原点的颜色添加提示信息和修改y轴的文字样式。

就是我图片圈起来的地方图片描述

这是我的代码 新手求大神指教

option = {
    tooltip : {
        trigger: 'axis',
     
    },
    
    toolbox: {
        show : true,
        feature : {
            mark : {show: true},
            dataView : {show: true, readOnly: false},
            magicType : {show: true, type: ['line', 'bar', 'stack', 'tiled']},
            restore : {show: true},
            saveAsImage : {show: true}
        }
    },
    calculable : true,
     
    xAxis : [
        {
            type : 'category',
            boundaryGap : false,
            data : ['2012','2013','2014','2015','2016','2017','2018']
        }
    ],
   grid: {
           'backgroundColor':'rgba(10,220,110,.5)',
           height:'200'
        },
     
    yAxis : [
        {
            type : 'value'
        }
    ],

axisLabel:{
        textStyle:{
             color:"#333333"//x轴,y轴的数字颜色,如图1
        }
    },
    axisTick:
    {
        show: false,
    },

    series : [

        {
            name:'推广流量',
            type:'line',
            stack: '总量',
            symbol:'circle',
            symbolSize:"10",
            itemStyle: {normal: {areaStyle: {type: 'default'}}},
               color: {
        type: 'linear',
        x: 0,
        y: 0,
        x2: 0,
        y2: 1,
        colorStops: [{
        offset: 1, color: '#fefeff' // 0% 处的颜色
    }, {
        offset: 0.4, color: '#e8efff' // 100% 处的颜色
    }],
    globalCoord: false // 缺省为 false
},
              itemStyle: {
                normal: {
                    areaStyle: {
                        // 区域图,纵向渐变填充
                     
                    },
                    lineStyle:{  
                     color:'#f68698'  
                                    }  
                }
            },

            data:[50, 110, 80, 200, 240, 70, 350]
        },
       
    ]
};
阅读 5.6k
2 个回答
新手上路,请多包涵

axisLabel: { //处理单位相关
formatter: '{value}单位'
},
axisLine: { //处理坐标轴颜色

        lineStyle: {
            color: 'red',
        }
    },

axisLabel: { //处理坐标轴字体

        color: '#000',   
    }

其实网上很多,
`//设置坐标轴的颜色
xAxis: [
{

type : 'category',
data : [],
splitLine: false,
nameTextStyle: {
  color: '' // x坐标轴名称文字样式
},
axisLine: {
  lineStyle: {
    color: '' //坐标轴线颜色
  }
}

}
]

//设置折现的颜色和折点的颜色

            series: [{
                data: number,
                type: 'line',
                itemstyle : {
                    normal : {
                        linestyle:{
                            color:'#16e868',
                        },
                        bordercolor:"#16e868"
                    }
                },
            }]
            

//设置坐标字体颜色

                    axisLabel: {
                        show: true,
                        textStyle: {
                            color: 'white'
                        }
                    },`
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题