echarts 一条折线图上显示不同颜色

文档树懒学堂:ECharts visualMap 代码实例及对应注释 - 树懒学堂

封装的echarts 组件代码:

<template>

    <div :style="{ height: '100%' }">

        <div class="foldLine" ref="foldLine" :style="{ width: widths, height: heights }"></div>

    </div>

</template>

<script>

import * as echarts from 'echarts';

export default {

    props: {

        id: {

            type: String,

            default: 'lineEchartNew'

        },

        heights: {

            type: String,

            default: '100%'

        },

        widths: {

            type: String,

            default: '100%'

        },

        tagName: {

            type: String,

            default: '排名'

        },

        indexName: {

            type: String,

            default: ''

        },

        chartObj: {

            type: Array,

            default: () => {

                return [];

            }

        },

        objs: {

            type: Object,

            default: () => {

                return {

                    height: '100%'

                };

            }

        }

    },

    data() {

        return {

            chart: null

        };

    },

    watch: {

        chartObj: {

            handler() {

                this.initEchats();

            },

            deep: true

        }

    },

    mounted() {

        this.$nextTick(() => {

            this.init();

        });

    },

    beforeDestroy() {

        this.chart && this.chart.dispose();

        this.chart = null;

    },

    methods: {

        init() {

            this.chart = echarts.init(this.$refs.foldLine);

            this.initEchats();

        },

        // 整体折线图显示不通颜色

        getLineColor(healthList) {

            let arr = [];

            healthList.forEach((v, i) => {

                let obj = {

                    gt: i,

                    lt: i + 1,

                    color: healthList[i] < 90 ? 'rgba(229,27,88,0.68)' : 'rgba(24,232,169,1)' //大于0小于12为绿色

                };

                arr.push(obj);

            });

            return arr;

        },

        initEchats() {

            let xDataList = []; // x轴

            let healthList = []; // 整体

            let xzHealthList = []; // 修障

            let zyHealthList = []; // 装移

            let zycolorList = []; // 装移

            let xzcolorList = []; // 修障

            let isColor = ''; // 整体

            //isColor == 1 说明低于90分 红色: #F32B2B

            this.chartObj &&

                this.chartObj.forEach((v, index) => {

                    xDataList.push(v.region);

                    // 整体

                    if (v.isColor == 0) {

                        isColor = 'rgba(24,232,169,1)';

                    } else if (v.isColor == 1) {

                        isColor = '#F32B2B'; // 红色

                        // isColor = 'rgba(24,232,169,1)';

                    }

                    // 装移

                    if (v.zyIsColor == 0) {

                        zycolorList[index] = ['#1EE7E7', 'rgba(30, 231, 231, 0.35)'];

                    } else if (v.zyIsColor == 1) {

                        zycolorList[index] = ['rgba(243, 43, 43, 0)', '#F32B2B'];

                    }

                    // 修障

                    if (v.xzIsColor == 0) {

                        xzcolorList[index] = ['#1890FF', 'rgba(24, 144, 255, 0.35)'];

                    } else if (v.xzIsColor == 1) {

                        xzcolorList[index] = ['rgba(243, 43, 43, 0)', '#F32B2B'];

                    }

                    if (!this.tagName || this.tagName == '排名') {

                        healthList.push(v.score);

                        xzHealthList.push(v.xzscore);

                        zyHealthList.push(v.zyscore);

                        this.legendData = [

                            {

                                show: true,

                                top: -3,

                                right: 110,

                                itemWidth: 10,

                                itemHeight: 2,

                                data: [

                                    {

                                        name: '整体',

                                        icon: 'rect'

                                    }

                                ],

                                itemStyle: {

                                    color: '#18E8A9'

                                },

                                textStyle: {

                                    fontSize: 12,

                                    lineHeight: 12,

                                    color: '#fff',

                                    rich: {

                                        a: {

                                            verticalAlign: 'middle'

                                        }

                                    },

                                    padding: [0, 0, -2, 0] //[上、右、下、左]

                                }

                            },

                            {

                                show: true,

                                top: -3,

                                right: 60,

                                itemWidth: 10,

                                itemHeight: 10,

                                data: [{ name: '装移', icon: 'rect' }],

                                textStyle: {

                                    fontSize: 12,

                                    lineHeight: 12,

                                    color: '#fff',

                                    rich: {

                                        a: {

                                            verticalAlign: 'middle'

                                        }

                                    },

                                    padding: [0, 0, -2, 0] //[上、右、下、左]

                                }

                            },

                            {

                                show: true,

                                top: -3,

                                right: 10,

                                itemWidth: 10,

                                itemHeight: 10,

                                data: [{ name: '修障', icon: 'rect' }],

                                textStyle: {

                                    fontSize: 12,

                                    lineHeight: 12,

                                    color: '#fff',

                                    rich: {

                                        a: {

                                            verticalAlign: 'middle'

                                        }

                                    },

                                    padding: [0, 0, -2, 0] //[上、右、下、左]

                                }

                            }

                        ];

                        if (this.indexName == '交付转化') {

                            this.legendData = [

                                {

                                    show: true,

                                    top: -3,

                                    right: 10,

                                    itemWidth: 10,

                                    itemHeight: 10,

                                    data: [{ name: '交付', icon: 'rect' }],

                                    textStyle: {

                                        fontSize: 12,

                                        lineHeight: 12,

                                        color: '#fff',

                                        rich: {

                                            a: {

                                                verticalAlign: 'middle'

                                            }

                                        },

                                        padding: [0, 0, -2, 0] //[上、右、下、左]

                                    }

                                }

                            ];

                        }

                        if (this.indexName == '修障重复申告率') {

                            this.legendData = [

                                {

                                    show: true,

                                    top: -3,

                                    right: 10,

                                    itemWidth: 10,

                                    itemHeight: 10,

                                    data: [{ name: '修障', icon: 'rect' }],

                                    textStyle: {

                                        fontSize: 12,

                                        lineHeight: 12,

                                        color: '#fff',

                                        rich: {

                                            a: {

                                                verticalAlign: 'middle'

                                            }

                                        },

                                        padding: [0, 0, -2, 0] //[上、右、下、左]

                                    }

                                }

                            ];

                        }

                    } else if (this.tagName == '整体') {

                        healthList.push(v.overall);

                        xzHealthList.push(v.xz);

                        zyHealthList.push(v.zy);

                        this.legendData = [

                            {

                                show: true,

                                top: -3,

                                right: 110,

                                itemWidth: 10,

                                itemHeight: 2,

                                data: [

                                    {

                                        name: '整体',

                                        icon: 'rect'

                                    }

                                ],

                                itemStyle: {

                                    color: '#18E8A9'

                                },

                                textStyle: {

                                    fontSize: 12,

                                    lineHeight: 12,

                                    color: '#fff',

                                    rich: {

                                        a: {

                                            verticalAlign: 'middle'

                                        }

                                    },

                                    padding: [0, 0, -2, 0] //[上、右、下、左]

                                }

                            },

                            {

                                show: true,

                                top: -3,

                                right: 60,

                                itemWidth: 10,

                                itemHeight: 10,

                                data: [{ name: '装移', icon: 'rect' }],

                                textStyle: {

                                    fontSize: 12,

                                    lineHeight: 12,

                                    color: '#fff',

                                    rich: {

                                        a: {

                                            verticalAlign: 'middle'

                                        }

                                    },

                                    padding: [0, 0, -2, 0] //[上、右、下、左]

                                }

                            },

                            {

                                show: true,

                                top: -3,

                                right: 10,

                                itemWidth: 10,

                                itemHeight: 10,

                                data: [{ name: '修障', icon: 'rect' }],

                                textStyle: {

                                    fontSize: 12,

                                    lineHeight: 12,

                                    color: '#fff',

                                    rich: {

                                        a: {

                                            verticalAlign: 'middle'

                                        }

                                    },

                                    padding: [0, 0, -2, 0] //[上、右、下、左]

                                }

                            }

                        ];

                        if (this.indexName == '交付转化') {

                            this.legendData = [

                                {

                                    show: true,

                                    top: -3,

                                    right: 10,

                                    itemWidth: 10,

                                    itemHeight: 10,

                                    data: [{ name: '交付', icon: 'rect' }],

                                    textStyle: {

                                        fontSize: 12,

                                        lineHeight: 12,

                                        color: '#fff',

                                        rich: {

                                            a: {

                                                verticalAlign: 'middle'

                                            }

                                        },

                                        padding: [0, 0, -2, 0] //[上、右、下、左]

                                    }

                                }

                            ];

                        }

                        if (this.indexName == '修障重复申告率') {

                            this.legendData = [

                                {

                                    show: true,

                                    top: -3,

                                    right: 10,

                                    itemWidth: 10,

                                    itemHeight: 10,

                                    data: [{ name: '修障', icon: 'rect' }],

                                    textStyle: {

                                        fontSize: 12,

                                        lineHeight: 12,

                                        color: '#fff',

                                        rich: {

                                            a: {

                                                verticalAlign: 'middle'

                                            }

                                        },

                                        padding: [0, 0, -2, 0] //[上、右、下、左]

                                    }

                                }

                            ];

                        }

                    } else if (this.tagName == '交付') {

                        healthList = [];

                        xzHealthList = [];

                        zyHealthList.push(v.zy);

                        this.legendData = [

                            {

                                show: true,

                                top: -3,

                                right: 10,

                                itemWidth: 10,

                                itemHeight: 10,

                                data: [{ name: this.indexName == '交付转化' ? '交付' : '装移', icon: 'rect' }],

                                textStyle: {

                                    fontSize: 12,

                                    lineHeight: 12,

                                    color: '#fff',

                                    rich: {

                                        a: {

                                            verticalAlign: 'middle'

                                        }

                                    },

                                    padding: [0, 0, -2, 0] //[上、右、下、左]

                                }

                            }

                        ];

                    } else if (this.tagName == '申告') {

                        healthList = [];

                        zyHealthList = [];

                        xzHealthList.push(v.xz);

                        this.legendData = [

                            {

                                show: true,

                                top: -3,

                                right: 10,

                                itemWidth: 10,

                                itemHeight: 10,

                                data: [{ name: this.indexName == '交付转化' ? '交付' : '修障', icon: 'rect' }],

                                textStyle: {

                                    fontSize: 12,

                                    lineHeight: 12,

                                    color: '#fff',

                                    rich: {

                                        a: {

                                            verticalAlign: 'middle'

                                        }

                                    },

                                    padding: [0, 0, -2, 0] //[上、右、下、左]

                                }

                            }

                        ];

                    }

                });

            let seriesAll = [

                {

                    name: '整体',

                    type: 'line',

                    // barWidth: 24,

                    barGap: '1%',

                    // symbol: 'rect',

                    symbolSize: [0, 0],

                    data: healthList,

                    // label: {

                    //     normal: {

                    //         show: true,

                    //         fontSize: 14,

                    //         color: '#fff',

                    //         formatter: '{c}',

                    //         position: 'top'

                    //     }

                    // },

                    itemStyle: {

                        color: 'rgba(24,232,169,1)',

                        // color: isColor,

                        borderColor: '#18E8A9',

                        borderWidth: 1,

                        borderType: 'solid'

                    }

                },

                {

                    name: '装移',

                    type: 'bar',

                    barWidth: 5,

                    barGap: '1%',

                    data: zyHealthList,

                    itemStyle: {

                        normal: {

                            //这里设置每个柱子颜色不一样

                            color: function (params) {

                                let colorItem = zycolorList[params.dataIndex];

                                if (colorItem !== undefined) {

                                    return new echarts.graphic.LinearGradient(

                                        0,

                                        0,

                                        0,

                                        1,

                                        [

                                            {

                                                offset: 0,

                                                color: colorItem[0]

                                            },

                                            {

                                                offset: 1,

                                                color: colorItem[1]

                                            }

                                        ],

                                        false

                                    );

                                }

                            }

                        }

                    }

                    // color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [

                    //     {

                    //         offset: 0,

                    //         color: '#1EE7E7 '

                    //     },

                    //     {

                    //         offset: 1,

                    //         color: 'rgba(30, 231, 231, 0.35)'

                    //     }

                    // ])

                },

                {

                    name: '修障',

                    type: 'bar',

                    barWidth: 5,

                    barGap: '1%',

                    data: xzHealthList,

                    itemStyle: {

                        normal: {

                            //这里设置每个柱子颜色不一样

                            color: function (params) {

                                let colorItem = xzcolorList[params.dataIndex];

                                if (colorItem !== undefined) {

                                    return new echarts.graphic.LinearGradient(

                                        0,

                                        0,

                                        0,

                                        1,

                                        [

                                            {

                                                offset: 0,

                                                color: colorItem[0]

                                            },

                                            {

                                                offset: 1,

                                                color: colorItem[1]

                                            }

                                        ],

                                        false

                                    );

                                }

                            }

                        }

                    }

                    // color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [

                    //     {

                    //         offset: 0,

                    //         color: '#1890FF '

                    //     },

                    //     {

                    //         offset: 1,

                    //         color: 'rgba(24, 144, 255, 0.35)'

                    //     }

                    // ])

                }

            ];

            let seriesJiaoFu = [

                {

                    name: '交付',

                    type: 'bar',

                    barWidth: 5,

                    barGap: '1%',

                    data: zyHealthList,

                    color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [

                        {

                            offset: 0,

                            color: '#1EE7E7 '

                        },

                        {

                            offset: 1,

                            color: 'rgba(30, 231, 231, 0.35)'

                        }

                    ])

                }

            ];

            let axisLabelAll = {

                color: 'rgba(230,247,255,0.85)',

                interval: 0, //0: x轴名字没有间隔隐藏,全部显示

                fontSize: 10,

                // rotate: 40, // 调整数值改变倾斜的幅度(范围-90到90)

                formatter: (text) => {

                    return text.replaceAll('分公司', '');

                }

            };

            let axisLabelMore = {

                color: 'rgba(230,247,255,0.85)',

                // interval: 0, //0: x轴名字没有间隔隐藏,全部显示

                fontSize: 10

            };

            let option = {

                tooltip: {

                    trigger: 'axis',

                    axisPointer: {

                        // 坐标轴指示器,坐标轴触发有效 设置鼠标放上去是线还是阴影

                        type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'

                    }

                    // formatter:function(param){

                    //     if(param.length>2){

                    //          return `

                    //          <p>时间:${param[0].name}</p>

                    //          <p>${param[0].seriesName}:能耗${param[0].data},PRB利用率:${param[1].data}</p>

                    //             <p>${param[2].seriesName}:能耗:${param[2].data},PRB利用率:${param[3].data}</p>

                    //         `

                    //     }else{

                    //          return `

                    //           <p>时间:${param[0].name}</p>

                    //          <p>${param[0].seriesName}:能耗${param[0].data},PRB利用率:${param[1].data}</p>

                    //         `

                    //     }

                    // }

                },

                legend: this.legendData,

                grid: {

                    top: '16%',

                    left: '3%',

                    right: '5%',

                    bottom: '7%',

                    containLabel: true

                },

                yAxis: {

                    name: '',

                    nameTextStyle: {

                        color: '#fff',

                        align: 'center'

                    },

                    nameGap: 20,

                    type: 'value',

                    splitLine: {

                        show: true,

                        lineStyle: {

                            //轴线样式

                            type: 'dashed', // dotted

                            color: 'rgba(230, 247, 255, 0.2)'

                        }

                    },

                    axisLine: {

                        //坐标轴轴线

                        show: false, //是否显示

                        lineStyle: {

                            //轴线样式

                            color: '#656A94'

                        }

                    },

                    axisTick: {

                        show: false //是否显示刻度

                    },

                    axisLabel: {

                        inside: false, //数值内侧外侧

                        // padding: [0, 4, 15, 0],

                        showMinLabel: true,

                        showMaxLabel: true,

                        color: 'rgba(230,247,255,0.6)',

                        fontSize: 12

                        // formatter:function(text,index){

                        //     return text+"%";

                        // }

                    }

                },

                xAxis: [

                    {

                        type: 'category',

                        data: xDataList,

                        axisLine: {

                            lineStyle: {

                                color: '#E6F7FF'

                            }

                        },

                        axisTick: {

                            show: false

                        },

                        // axisLabel: {

                        //     color: 'rgba(230,247,255,0.85)',

                        //     interval: 0, //0: x轴名字没有间隔隐藏,全部显示

                        //     fontSize: 10,

                        //     // rotate: 40, // 调整数值改变倾斜的幅度(范围-90到90)

                        //     formatter: (text) => {

                        //         return text.replaceAll('分公司', '');

                        //     }

                        // }

                        axisLabel: xDataList.length > 12 ? axisLabelMore : axisLabelAll

                    },

                    {

                        type: 'category',

                        axisLine: {

                            show: false

                        },

                        axisTick: {

                            show: false

                        },

                        axisLabel: {

                            show: false

                        }

                    }

                ],

                series: this.indexName == '交付转化' ? seriesJiaoFu : seriesAll,

                // 一条折线图显示不通颜色

                visualMap:

                    this.indexName == '交付转化'

                        ? null

                        : {

                              type: 'piecewise',

                              show: false,

                              dimension: 0,

                              seriesIndex: 0,

                              pieces: this.getLineColor(healthList)

                              //   pieces: [

                              //       {

                              //           gt: 0,

                              //           lt: 1,

                              //           color: healthList[0] < 90 ? 'rgba(229,27,88,0.68)' : 'rgba(24,232,169,1)' //大于0小于12为绿色

                              //       },

                              //       {

                              //           gt: 1,

                              //           lt: 2,

                              //           color: healthList[1] < 90 ? 'rgba(229,27,88,0.68)' : 'rgba(24,232,169,1)' //大于0小于12为绿色

                              //       },

                              //   ]

                          }

            };

            if (option && typeof option === 'object') {

                this.chart.clear(); //画布清空

                this.chart.resize(); //自适应div的大小

                this.chart.setOption(option, true);

                // this.chart.setOption(

                //     {

                //         series: seriesArr

                //     },

                //     { notMerge: false, lazyUpdate: false, silent: false }

                // );

            }

        }

    }

};

</script>

<style lang="scss" scoped></style>

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/375750.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

【数据结构】链表OJ面试题3(题库+解析)

1.前言 前五题在这http://t.csdnimg.cn/UeggB 后三题在这http://t.csdnimg.cn/gbohQ 记录每天的刷题&#xff0c;继续坚持&#xff01; 2.OJ题目训练 9. 给定一个链表&#xff0c;判断链表中是否有环。 力扣&#xff08;LeetCode&#xff09;官网 - 全球极客挚爱的技术成…

工业以太网交换机引领现代工厂自动化新潮流

随着科技的飞速发展&#xff0c;现代工厂正迎来一场前所未有的自动化变革&#xff0c;而工业以太网交换机的崭新角色正是这场变革的关键组成部分。本文将深入探讨工业以太网交换机与现代工厂自动化的紧密集成&#xff0c;探讨这一集成如何推动工业生产的智能化、效率提升以及未…

UDP端口探活的那些细节

一 背景 商业客户反馈用categraf的net_response插件配置了udp探测, 遇到报错了&#xff0c;如图 udp是无连接的&#xff0c;无法用建立连接的形式判断端口。 插件最初的设计是需要配置udp的发送字符&#xff0c;并且配置期望返回的字符串&#xff0c; [[instances]] targets…

VSCode无法启动:Waiting for server log...

问题基本情况 [13:30:20.720] > code 1.86.0 (commit 05047486b6df5eb8d44b2ecd70ea3bdf775fd937) [13:30:20.724] > Running ssh connection command... /var/fpwork/reiss/vscdata/server/cplane/.vscode-server/code-05047486b6df5eb8d44b2ecd70ea3bdf775fd937 comman…

【RT-DETR有效改进】轻量级下采样方法ContextGuided(参数量下降700W,轻量又涨点)

&#x1f451;欢迎大家订阅本专栏&#xff0c;一起学习RT-DETR&#x1f451; 一、本文介绍 本文给大家带来的是改进机制是一种替换Conv的模块Context Guided Block (CG block) &#xff0c;其是在CGNet论文中提出的一种模块&#xff0c;其基本原理是模拟人类视觉系统依赖上…

centos 7.6 安装cas 对接ldap 单点登录实战

centos 7.6 安装cas 对ldap 单点登录实战 1、安装前准备工作1.1、centos 7.6 安装JDK 1.81.2、centos 7 安装tomcat 9.0.841.3、windows10 安装JDK 1.81.4、windows10 安装打包工具 maven 3.9.6 2、下载cas 5.3 并打包成war包3、部署cas到tomcat4、cas对接ldap 1、安装前准备工…

SQL注入讲解-BeesCMS系统漏洞分析溯源

判断网页框架 渗透思路 以前的思路 1.首先识别一下指纹 根据指纹查找历史漏洞(同样适用现在) 2.查找目录(目录里面会有很多惊喜) 通过御剑后台扫描工具找到文件夹后在网页打开文件夹进行测试 通过百度搜索查看历史漏洞 查看源代码发现它对账号和密码只有二个加密 我们通过bu…

LeetCode:26.删除有序数组中的重复项

26. 删除有序数组中的重复项 - 力扣&#xff08;LeetCode&#xff09; 目录 题目&#xff1a; 思路&#xff1a; 代码注释&#xff1a; 每日表情包&#xff1a; 题目&#xff1a; 思路&#xff1a; 没啥特殊的&#xff0c;老老实实双指针遍历数组&#xff0c;&#xff0…

谷歌seo搜索引擎优化教程有吗?

教程&#xff0c;教学&#xff0c;指南&#xff0c;这些东西哪里都有&#xff0c;尤其是关于seo相关方面的&#xff0c;这些可以说到处都是&#xff0c;能把谷歌seo这个关键词做上去的&#xff0c;可以说就是实力的证明了&#xff0c;在这里我们说一个无论是老手还是新手都应该…

archlinux 使用 electron-ssr 代理 socks5

提前下载好 pacman 包 https://github.com/shadowsocksrr/electron-ssr/releases/download/v0.2.7/electron-ssr-0.2.7.pacman 首先要有 yay 和 aur 源&#xff0c;这个可以参考我之前的博客 虚拟机内使用 archinstall 安装 arch linux 2024.01.01 安装依赖 yay 安装的&#…

Linux下centos操作系统安装Mysql8.0过程及踩坑填补

我自己有一台服务器&#xff0c;之前安装的是MySQL5.5&#xff0c;现在我想升级为MySQL8.0&#xff0c;于是我干了以下操作,既有踩坑又有干货&#xff1a; 1.先卸载MySQL&#xff1b; 2.删除跟MySQL相关文件&#xff1b; 3.安装新的MySQL8.0版本&#xff08;这里踩了一个坑&…

破除Github API接口的访问次数限制

破除Github API接口的访问次数限制 1、Github介绍2、Github API接口2.1 介绍2.2 使用方法 3、Github API访问限制3.1 访问限制原因3.2 访问限制类别 4、Github API访问限制破除4.1 限制破除原理4.2 限制破除示例 1、Github介绍 Github&#xff0c;是一个面向开源及私有软件项目…

VS2017+Qt中文无法编译通过newline in constant解决办法

首先说我的解决办法 Tools->Extensions and Updates… 安装ForceUTF8(with BOM) 注意Force这个插件有好几个版本&#xff0c;一定要withBOM&#xff01;&#xff01;&#xff01;我之前安装的没有BOM导致改了各种设置还是一直编译不过&#xff0c;差点没气死我 另外代码里…

Mac电脑删除第三方软件的最简单方法(2024最新教程)

Mac用户经常会下载各种第三方软件来提高工作效率或娱乐体验。然而&#xff0c;随着时间的推移&#xff0c;一些软件可能不再需要&#xff0c;或者用户可能想要清理空间。在这种情况下&#xff0c;有效地删除这些第三方软件变得尤为重要。本文将介绍几种常规的Mac删除第三方软件…

react+antd+CheckableTag实现Tag标签单选或多选功能

1、效果如下图 实现tag标签单选或多选功能 2、环境准备 1、react18 2、antd 4 3、功能实现 原理: 封装一个受控组件&#xff0c;接受父组件的参数&#xff0c;数据发现变化后&#xff0c;回传给父组件 1、首先&#xff0c;引入CheckableTag组件和useEffect, useMemo, use…

动态规划01 三步问题[C++]

​​​​​​ 图源&#xff1a;文心一言 上机题目练习整理&#xff0c;本篇作为动态规划的代码&#xff0c;因为做题入门很少找到带图的讲解&#xff08;难道是因为太简单&#xff0c;所以没有人嘛&#xff09;&#xff0c;所以干脆自己写一份&#xff0c;供小伙伴们参考~&am…

CSS的动画

CSS的动画 在本节&#xff0c;我们将学习keyframes动画。 1. 动画的基本使用 1. 定义动画 定义动画有两种写法&#xff1a; 简单定义方式 keyframes 动画名 {/* from代表初始状态 */from {/*property1:value1*/transform: translate(0%);}/* to代表结束状态 */to {transfor…

Win32 SDK Gui编程系列之--弹出式菜单

1.弹出式菜单 例如,在命令提示窗口中点击鼠标右键,会出现如下图所示的弹出菜单(下拉菜单)。 这种弹出式菜单的实现很简单。不创建菜单栏,用CreatePopupMenu函数创建的菜单是最顶端的菜单就可以了。 菜单的显示使用TrackPopupMenu函数进行。 例如,点击鼠标右键显示弹出…

JAVA装饰器模式详解

装饰器模式 1 装饰器模式介绍 装饰模式(decorator pattern) 的原始定义是&#xff1a;动态的给一个对象添加一些额外的职责. 就扩展功能而言,装饰器模式提供了一种比使用子类更加灵活的替代方案. 假设现在有有一块蛋糕,如果只有涂上奶油那这个蛋糕就是普通的奶油蛋糕, 这时如…

[职场] 智能材料与结构专业的就业前景 #经验分享#学习方法

智能材料与结构专业的就业前景 智能材料与结构专业是面向国家智能制造强国战略&#xff0c;面向地方经济新旧动能转换需求&#xff0c;学习智能材料与结构的基础理论及基本知识&#xff0c;接受智能材料制备、组织分析、性能测试、智能材料系统集成技能的基本训练&#xff0c;…
最新文章