vue中echarts的使用以及与elementui-select的协同绑定

本文介绍了如何在Vue项目中使用ECharts图表,并详细讲述了如何实现ECharts与ElementUI Select组件的协同绑定,以实现数据选择与图表更新的联动效果。
摘要由CSDN通过智能技术生成

vue中echarts的使用以及与elementui-select的协同绑定

1.vue中echarts的使用

引入echarts后

let myChart = echarts.init(document.getElementById('dsm'));//dsm为绑定的dom结构
            var option = {
   
                //backgroundColor:"#111c4e",    
                    tooltip: {
   
                        trigger: 'axis'
                    },
                    legend: {
                     //图表上方的图例显隐
                        data:['光合有效辐射'],
                         textStyle: {
   
                                color: '#fff'
                            }
                    },
                    color:['#E4FD0A'],
                    grid: {
                       //图表里上下左右的空间 间隙
                        left: '3%',
                        right: '8%',
                        bottom: '3%',
                        containLabel: true
                    },
                    xAxis: {
                                 //x轴属性
                        type: 'category',
                        name: '日期/时间',
                        // boundaryGap: false,
                        data: this.xZhou,
                        axisLine:{
   
                        lineStyle:{
   color:'#fff'}    // x轴坐标轴颜色
                        },
                        axisLabel: {
   
                            show: true,
                            color: '#fff',
                            fontSize:12,
                            // rotate: 30
                        }
                    },
                    yAxis: {
                          //y轴属性
                        type: 'value',
                        name: '光合有效辐射',
                        axisLine:{
   
                        lineStyle:{
   color:'#fff'}    // x轴坐标轴颜色
                        },
                        axisLabel: {
   
                            show: true,
                            color: '#fff',
                            fontSize:12,
                            // rotate: 30
                        }
                    },
                    series: [                       //为鼠标在图表中划过时显示的数据
                        {
   
                            name:'光合有效辐射',
                            type:'line',
                            stack: '总量',
                            data:this.yZhou,
                            lineStyle:{
   
                                normal:{
   
                                    color: '#E4FD0A'
                                }
                    
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值