echarts配置

2023-07-27 11:13:58 阅读:3 编辑

辅助线(网络线)--适合xAxis,yAxis

 splitLine: {
                                show: true,
                                lineStyle: {
                                    color: ['rgba(255,255,255,0.5)'],
                                    width: 1,
                                    type: 'dashed'
                                }
                            }

x,y轴的字体颜色(适合xAxis,yAxis)

axisLabel: {
                                show: true,
                                textStyle: {
                                    color: '#ffffff'
                                }
                            }

渐变颜色

color: new this.$echarts.graphic.LinearGradient(0, 0, 0, 1, [
                                    {
                                        offset: 0,
                                        color: 'rgba(15,255,189,0.5)'
                                    },
                                    {
                                        offset: 1,
                                        color: 'rgba(15,255,189,0)'
                                    }
                                ])

地图点击

 this.myChart.on('click', function (params) {
                console.log(params);
                //param.dataIndex为data的索引值,name为市名

            });