首页 > 其他分享 >今天帮学长写页面了QVQ

今天帮学长写页面了QVQ

时间:2024-04-23 22:34:13浏览次数:14  
标签:false color lineStyle 学长 rgba 页面 true QVQ 255

function echarts_3() {
        var myChart = echarts.init(document.getElementById('echart3'));

        var years = [
            '2008', '2009', '2010', '2011', '2012', '2013', '2014', '2015',
            '2016', '2017', '2018', '2019', '2020'
        ];

        var option = {
            tooltip: {
                trigger: 'axis',
                axisPointer: {
                    lineStyle: {
                        color: 'rgb(194,19,9)'
                    }
                },
                formatter: function (params) {
                    var tooltip = params[0].name + '<br />';
                    params.forEach(function (item) {
                        tooltip += item.seriesName + ': ' + Math.round(item.data) + '<br />';
                    });
                    return tooltip;
                }
            },
            legend: {
                top: '0%',
                data: ['东部地区', '西部地区', '南部地区', '中部地区'],
                textStyle: {
                    color: 'rgb(194,19,9)',
                    fontSize: '12',
                }
            },
            grid: {
                left: '10',
                top: '30',
                right: '10',
                bottom: '10',
                containLabel: true
            },
            xAxis: {
                type: 'category',
                boundaryGap: false,
                axisLabel: {
                    textStyle: {
                        color: "rgb(194,19,9)",
                        fontSize: 12,
                    },
                },
                axisLine: {
                    lineStyle: {
                        color: 'rgb(194,19,9)'
                    }
                },
                data: years
            },
            yAxis: {
                type: 'value',
                name: '次数', // 修改 y 轴名称
                axisTick: { show: false },
                axisLine: {
                    lineStyle: {
                        color: 'rgb(194,19,9)'
                    }
                },
                axisLabel: {
                    textStyle: {
                        color: "rgb(194,19,9)",
                        fontSize: 12,
                    },
                    formatter: '{value}' // 设置 y 轴标签的格式为整数
                },
                splitLine: {
                    lineStyle: {
                        color: 'rgba(255,255,255,.1)'
                    }
                }
            },
            series: [
                {
                    name: '东部地区',
                    type: 'line',
                    smooth: true,
                    symbol: 'circle',
                    symbolSize: 5,
                    showSymbol: false,
                    lineStyle: {
                        color: 'rgb(145,219,255)',
                        width: 2
                    },
                    areaStyle: {
                        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                            offset: 0,
                            color: 'rgba(31, 174, 234, 0.4)'
                        }, {
                            offset: 0.8,
                            color: 'rgba(31, 174, 234, 0.1)'
                        }], false),
                        shadowColor: 'rgba(255,255,255)',
                    },
                    itemStyle: {
                        color: '#1f7eea',
                        borderColor: 'rgba(31, 174, 234, .1)',
                        borderWidth: 5
                    },
                    data: [
                        24, 20, 17, 14, 12, 10, 9, 9, 9, 8, 7, 6, 5
                    ],
                    animation: true, // 开启入场动画
                    animationDuration: 8000,  // 动画时长,单位为毫秒(ms)
                    animationEasing: 'cubicInOut',
                },
                {
                    name: '西部地区',
                    type: 'line',
                    smooth: true,
                    symbol: 'circle',
                    symbolSize: 5,
                    showSymbol: false,
                    lineStyle: {
                        color: '#a2ffc8',
                        width: 2
                    },
                    areaStyle: {
                        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                            offset: 0,
                            color: 'rgba(107, 221, 155, 0.4)'
                        }, {
                            offset: 0.8,
                            color: 'rgba(107, 221, 155, 0.1)'
                        }], false),
                        shadowColor: 'rgba(255,255,255)',
                    },
                    itemStyle: {
                        color: '#6bdd9b',
                        borderColor: 'rgba(107, 221, 155, .1)',
                        borderWidth: 5
                    },
                    data: [
                        11, 13, 13, 14, 13, 14, 16, 16, 18, 21, 23, 30, 30
                    ],
                    animation: true, // 开启入场动画
                    animationDuration: 8000,  // 动画时长,单位为毫秒(ms)
                    animationEasing: 'cubicInOut',
                },
                {
                    name: '南部地区',
                    type: 'line',
                    smooth: true,
                    symbol: 'circle',
                    symbolSize: 5,
                    showSymbol: false,
                    lineStyle: {
                        color: '#ffb880',
                        width: 2
                    },
                    areaStyle: {
                        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                            offset: 0,
                            color: 'rgba(255, 184, 128, 0.4)'
                        }, {
                            offset: 0.8,
                            color: 'rgba(255, 184, 128, 0.1)'
                        }], false),
                        shadowColor: 'rgba(255,255,255)',
                    },
                    itemStyle: {
                        color: '#ff9f57',
                        borderColor: 'rgba(255, 184, 128, .1)',
                        borderWidth: 5
                    },
                    data: [
                        16, 20, 25, 32, 37, 43, 44, 44, 45, 46, 48, 52, 55
                    ],
                    animation: true, // 开启入场动画
                    animationDuration: 8000,  // 动画时长,单位为毫秒(ms)
                    animationEasing: 'cubicInOut',
                },
                {
                    name: '中部地区',
                    type: 'line',
                    smooth: true,
                    symbol: 'circle',
                    symbolSize: 5,
                    showSymbol: false,
                    lineStyle: {
                        color: '#ff0000',
                        width: 2
                    },
                    areaStyle: {
                        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                            offset: 0,
                            color: 'rgba(255, 0, 0, 0.4)'
                        }, {
                            offset: 0.8,
                            color: 'rgba(255, 0, 0, 0.1)'
                        }], false),
                        shadowColor: 'rgba(255,255,255)',
                    },
                    itemStyle: {
                        color: '#ff0000',
                        borderColor: 'rgba(255, 0, 0, .1)',
                        borderWidth: 5
                    },
                    data: [
                        16, 11, 20, 16, 30, 18, 14, 42, 32, 26, 36, 61, 75
                    ],
                    animation: true, // 开启入场动画
                    animationDuration: 8000,  // 动画时长,单位为毫秒(ms)
                    animationEasing: 'cubicInOut',
                }
            ],

        };



        myChart.setOption(option);


        window.addEventListener("resize", function () {
            myChart.resize();
        });


        let i = 0
        setInterval(function () {
            console.log(i)
            i = i === 13 ? 0 : i + 1
            myChart.dispatchAction({

                type: 'showTip',
                seriesIndex: 0,  // 显示第几个series
                dataIndex: i // 显示第几个数据
            });
        }, 2000)

        /* // 每隔5秒刷新一次图表
        setInterval(function () {
            myChart.clear(); // 清除图表内容
            myChart.setOption(option); // 重新设置图表配置
        }, 13000); */


    }

 

标签:false,color,lineStyle,学长,rgba,页面,true,QVQ,255
From: https://www.cnblogs.com/muzhaodi/p/18153947

相关文章

  • echarts柱状图 实现点击每个柱状图跳转到新页面
    myChart.setOption(option);myChart.getZr().on('click',params=>{//规定代码块↓↓constpointInPixel=[params.offsetX,params.offsetY];if(myChart.containPixel('......
  • 在页面中居中一个div
    如何在一个页面中居中一个div?方法一:<div    style="width:100px;    height:100px;    background:red;    position:absolute;    top:50%;    left:50%;    margin:-50px00-50px;">  </div>......
  • 自定义登录和登出页面
    自定义登录在默认的情况下,SpringSecurity为我们生成的登录登出页面如下:我们可以自定义登录和登出页面,我们使用thymeleaf来编写登录页面,代码如下:<!DOCTYPEhtml><htmlxmlns="http://www.w3.org/1999/xhtml"xmlns:th="https://www.thymeleaf.org"><head><title>Pleas......
  • 前端页面渲染(文档+数据)不同模式
    一张可被用户访问的页面,可以被拆分为主文档(html)和数据两个部分,这两个部分既可以是组合在一起的(SSR),也可以是分离的(SPA、异步渲染)。比如一些活动搭建平台,可以增加一个数据网关,实现SSR,提升用户体验。服务端渲染(Server-SideRendering,SSR)服务端渲染是一种在服务器上生成完整......
  • 微信小程序页面功能-----标签切换
    一、页面布局首先我们需要布局出标签切换的页面,下面不多描述直接上代码1、html部分<!--标签页标题--><viewclass="tob"><viewclass="tab-item">音乐推荐器</view><viewclass="tab-item">播放器</view><viewclass="tab-item&quo......
  • 原生js图片截取并渲染页面
    一、将海报大图截屏部分图片并渲染页面二、实现代码如下<!DOCTYPEhtml><htmllang="zh"> <head> <metacharset="UTF-8"> <metaname="viewport"content="width=device-width,initial-scale=1.0"> <title>Do......
  • 模拟在页面点击导入csv
    案例背景组件性能测试过程中,要导入大量自定义的数据。案例分析本案例中采用python的pandas库,模拟了生成导入csv文件,模拟在页面点击导入csv,使文件导入更高效。实现方案1****、在前端页面解析内部接口参数典型的导入流程至少包含上传文件和确认上传。上传文件在浏览......
  • 一个静态页面接入科大讯飞3.5AI
      静态文件html<!DOCTYPEhtml><htmllang="en"><head><metacharset="UTF-8"><metaname="viewport"content="width=device-width,initial-scale=1.0"><metahttp-equiv="......
  • el-transffer大数据量页面卡顿优化
    Elementtransfer组件数据量大卡顿优化&&添加虚拟滚动,几万以内的数据量不会卡顿,用法和element的el-transfer完全一样安装npminstallel-virtual-transfer--save使用importElTransferVirtualfrom'element-transfer-virtual';1、组件内注册一下comp......
  • 今天依然是写前端的一天--前端页面的搭建
    <!--Login.vue--><scriptsetup>import{User,Lock}from'@element-plus/icons-vue'import{ref}from'vue'//控制注册与登录表单的显示,默认显示注册constisRegister=ref(false)//定义数据模型constregisterData=ref({username:'&#......