Echarts—X轴鼠标滑动或者缩放/多列柱状图中某一列数据为0时不占位

news2024/11/15 9:38:06

这里写目录标题

  • 需求背景
  • 图表展示
  • X轴鼠标滑动或者缩放设置
  • 多列柱状图中某一列数据为0时不占位
  • 图表代码展示

需求背景

  1. 用柱状图展示12个月的项目对应的供应商数据;
  2. 每个月有多个项目不确定,1-50之间,也就是说,12个月,每个月的X轴上有不确定的柱状;例如:1月有20根柱子,2月有5根柱子,3月有15根…
  3. 每月的每根柱子代表是一个项目,鼠标移入每月的每一个项目的柱子上要悬浮展示该月该项目具体供应商的情况;

当时听了这个需求,我就很不解,这数据都是不确定的,咋展示,如果只展示一个月的数据还可以,然后通过按钮去选择月份渲染,展示一年的数据,就有点小复杂啦;

图表展示

X轴数据那么多,还不确定,只能看卡能不能实现滑动,结果还真能,那就好办啦,

当然肯定还是实现啦,先把实现图表展示一下,如下图:
在这里插入图片描述
在这里插入图片描述

图表上的数据也是自己随意mock的,由于柱子数量布丁,颜色也是随机的,这些都不要在意不要,重点是图表的实现;

以上是图表主要涉及到知识点有:
1.X轴鼠标滑动或者缩放、
2.多列柱状图中其中某一列数据为0时不占位

X轴鼠标滑动或者缩放设置

 dataZoom : [{
     type: 'slider',//给x轴设置滚动条
       show: true, //flase直接隐藏图形
       xAxisIndex: [0,1,2,3,4,5,6,7,8,9,10,11],
       bottom:5,
       height:15,
       showDetail: true,
       startValue: 0,//滚动条的起始位置
       endValue: 4 //滚动条的截止位置(按比例分割你的柱状图x轴长度)
     },
     {
       type: 'inside',//设置鼠标滚轮缩放
       disabled: true,
       xAxisIndex: [0,1,2,3,4,5,6,7,8,9,10,11],
       startValue: 0,
       endValue: 4
 }],

多列柱状图中某一列数据为0时不占位

正常多列柱状图,某一列数据为0时,是不显示的,但是还是会占位的,如下图:
在这里插入图片描述
很明显这样是很难看的,我们如要遍历然后过滤掉value值为0的柱子,把有值的柱形数据塞到 series 中,但是要配合xAxis 数据,所以我们重新格式化了一下xAxis 和 series ,方法如下图:

  let xAxis=[]
  let xAxisitem={
      type: 'category',
      data: '',
      position: 'bottom',
      axisTick: {
          show: true
      },
  }
  var emphasisStyle = {
    itemStyle: {
      shadowBlur: 10,
      shadowColor: 'rgba(0,0,0,0.3)'
    }
  };
  let xAxisitemdata=[]
  for (let i = 0; i < valueData.length ; i++) {
      xAxisitemdata=[]
      for (let i = 0; i < valueData.length ; i++) {
          xAxisitemdata.push('')
      }
      xAxisitemdata[i]=valueData[i].name
      xAxisitem.data=JSON.parse(JSON.stringify(xAxisitemdata))
      xAxis.push(JSON.parse(JSON.stringify(xAxisitem)))
  }
   // console.log("xAxis",xAxis)


   let series=[]

   for (let j = 0; j < valueData.length; j++) {
       for (let i = 0; i < valueData[j].data.length; i++) {
           let newArrList = [];
           for (let a = 0; a < j; a++) {
               newArrList.push({});
           }
           newArrList[j] = valueData[j].data[i];
           for (let k = 0; k < legenddata.length; k++) {
               let seriesitem={
                   type: 'bar',
                   name:legenddata[i],
                   barWidth: '10',
                   xAxisIndex: j,
                   emphasis: emphasisStyle,
                   itemStyle:{
                     barBorderRadius: [5, 5, 0, 0],//(顺时针左上,右上,右下,左下)
                   },
                   data: newArrList,
               }
               let a = j % legenddata.length;
               if((valueData[j].data[i]).value !==0 && k===a){
                   series.push(JSON.parse(JSON.stringify(seriesitem)))
               }
           }
       }
   }
   //console.log("series",series)
  

打印的xAxis 如下图:

在这里插入图片描述
注意看红框标记的,每月的data,只有当月显示,其他月为空;

打印的series如下图:

在这里插入图片描述
12个月,按10个项目,正常数据应该有120个,这里只有81个,就是所有有值的柱子的集合,把值为0的已经过滤掉,不显示,这样就不会炸图表中占位;

图表代码展示

下面我们就把上面图表的实现代码展示出来,开袋即食!

 <template>
   <div id="myChartFour"  style="height: 260px;"></div>
 </template>
 
 <script>
 import Vue from 'vue'
 export default {
   data(){
     return{
       echartData:[]
     }
   },
   mounted(){
       this.getEchartData()
   },
   methods:{
    getEchartData(){
        Vue.axios.get('/getReportDataFour', {}).then(res => {
            if(res.status == 200){
               this.echartData = res.data.datalist
               this.initEchart(this.echartData)
            }
        })
    },
    initEchart(valueData) {
        var chartDom = document.getElementById('myChartFour');
        var myChart = this.$echarts.init(chartDom);
        let legenddata = []
        var singleData  
        var dateLength = 0
        valueData.forEach(item => {
           if(item.data.length > dateLength){
             singleData = item.data
             dateLength = item.data.length
           }
        })
        singleData.forEach(item => {
          legenddata.push(item.name)
        })
        let xAxis=[]
        let xAxisitem={
            type: 'category',
            data: '',
            position: 'bottom',
            axisTick: {
                show: true
            },
        }
        var emphasisStyle = {
          itemStyle: {
            shadowBlur: 10,
            shadowColor: 'rgba(0,0,0,0.3)'
          }
        };
        let xAxisitemdata=[]
        for (let i = 0; i < valueData.length ; i++) {
            xAxisitemdata=[]
            for (let i = 0; i < valueData.length ; i++) {
                xAxisitemdata.push('')
            }
            xAxisitemdata[i]=valueData[i].name
            xAxisitem.data=JSON.parse(JSON.stringify(xAxisitemdata))
            xAxis.push(JSON.parse(JSON.stringify(xAxisitem)))
        }
       // console.log("xAxis",xAxis)
        let series=[]

        for (let j = 0; j < valueData.length; j++) {
            for (let i = 0; i < valueData[j].data.length; i++) {
                let newArrList = [];
                for (let a = 0; a < j; a++) {
                    newArrList.push({});
                }
                newArrList[j] = valueData[j].data[i];
                for (let k = 0; k < legenddata.length; k++) {
                    let seriesitem={
                        type: 'bar',
                        name:legenddata[i],
                        barWidth: '10',
                        xAxisIndex: j,
                        emphasis: emphasisStyle,
                        itemStyle:{
                          barBorderRadius: [5, 5, 0, 0],//(顺时针左上,右上,右下,左下)
                        },
                        data: newArrList,
                    }
                    let a = j % legenddata.length;
                    if((valueData[j].data[i]).value !==0 && k===a){
                        series.push(JSON.parse(JSON.stringify(seriesitem)))
                    }
                }
            }
        }
        //console.log("series",series)
        let series1= JSON.parse(JSON.stringify(series))
        function getColor(num){
          var colorArr = []
          var colorValue="0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f";
          //以","为分隔符,将colorValue字符串分割为字符数组["0","1",...,"f"]
          var colorArray = colorValue.split(",");
          
          for( var j = 0; j<num;j++){
            var color="#";
            for(var i=0;i<6;i++){
                  color+=colorArray[Math.floor(Math.random()*16)];
              }
              colorArr.push(color)
          }
          return  colorArr
             
        }
        const option = {
            tooltip: {
              extraCssText: 'box-shadow: 0 0 3px rgba(0, 0, 0, 0.5);',
              backgroundColor:'rgba(255,255,255,.8)',
              confine: true ,
              textStyle:{
                  color: '#3d3d3d' ,
                  fontSize: 14 ,
              },
              formatter: function(params) {
                    const result = params.data
                    var apercent = result.a !== 0 ? ((result.a / result.value) * 100) .toFixed(1) + '%' : '0%'
                    var bpercent = result.b !== 0 ? ((result.b / result.value) * 100) .toFixed(1) + '%' : '0%'
                    var cpercent = result.c !== 0 ? ((result.c / result.value) * 100) .toFixed(1) + '%' : '0%'
                    var dpercent = result.d !== 0 ? ((result.d / result.value) * 100) .toFixed(1) + '%' : '0%'
                    return  `
                       <div style="padding:10px 20px 10px 10px">
                         <div>
                            <span style="font-size:14px;font-weight:700">${params.seriesName}</span><span style="margin-left:15px;font-weight:700">${result.value}个</span>
                         </div>
                         <ul>
                            <li style="padding:3px 0;">${params.marker}A级:<span style="padding:0 15px;">${result.a}个</span><span>${apercent}</span></li>
                            <li style="padding:3px 0;">${params.marker}B级:<span style="padding:0 15px;">${result.b}个</span><span>${bpercent}</span></li>
                            <li style="padding:3px 0;">${params.marker}C级:<span style="padding:0 15px;">${result.c}个</span><span>${cpercent}</span></li>
                            <li style="padding:3px 0;">${params.marker}D级:<span style="padding:0 15px;">${result.d}个</span><span>${dpercent}</span></li>
                         </ul>
                       </div>
                    `
                }
            },
            color:getColor(25),
            legend:{
              show:false,
              data:legenddata,
            },
            dataZoom : [{
                  type: 'slider',//给x轴设置滚动条
                  show: true, //flase直接隐藏图形
                  xAxisIndex: [0,1,2,3,4,5,6,7,8,9,10,11],
                  bottom:5,
                  height:15,
                  showDetail: true,
                  startValue: 0,//滚动条的起始位置
                  endValue: 4 //滚动条的截止位置(按比例分割你的柱状图x轴长度)
                },
                {
                  type: 'inside',//设置鼠标滚轮缩放
                  disabled: false,
                  xAxisIndex: [0,1,2,3,4,5,6,7,8,9,10,11],
                  startValue: 0,
                  endValue: 4
            }],
            grid: {
                left: 40,
                right: 10,
                top: 25,
                bottom: 25,
            },
            xAxis: xAxis,
            yAxis: [
                {
                    type: 'value',
                    name:'供应商数量(个)',
                    nameGap: 10,
                    // max:12,
                    nameTextStyle:{

                    },
                    splitLine:{
                        show :true,
                        lineStyle:{
                          type:'dashed'
                        }
                    },
                    
                }
            ],
            series:series1
        };
        myChart.setOption(option)
        window.addEventListener("resize", () => {
            myChart.resize();
        });
    },
   }
 }
 </script>

mock的数据结构如下图:

{
    "datalist":[
        {
            "name":"1月",
            "data":[
                {"value":10,"a":2,"b":3,"c":4,"d":1,"name":"项目一"},
                {"value":8,"a":2,"b":3,"c":4,"d":1,"name":"项目二"},
                {"value":6,"a":2,"b":3,"c":4,"d":1,"name":"项目三"},
                {"value":4,"a":2,"b":3,"c":4,"d":1,"name":"项目四"},
                {"value":0,"a":0,"b":0,"c":0,"d":0,"name":"项目五"},
                {"value":10,"a":2,"b":3,"c":4,"d":1,"name":"项目六"},
                {"value":7,"a":2,"b":3,"c":4,"d":1,"name":"项目七"},
                {"value":9,"a":2,"b":3,"c":4,"d":1,"name":"项目八"},
                {"value":11,"a":2,"b":3,"c":4,"d":1,"name":"项目九"},
                {"value":10,"a":2,"b":3,"c":4,"d":1,"name":"项目十"}
            ]
        },
        {
            "name":"2月",
            "data":[
                {"value":0,"a":0,"b":0,"c":0,"d":0,"name":"项目一"},
                {"value":8,"a":2,"b":3,"c":4,"d":1,"name":"项目二"},
                {"value":4,"a":2,"b":3,"c":4,"d":1,"name":"项目三"},
                {"value":4,"a":2,"b":3,"c":4,"d":1,"name":"项目四"},
                {"value":0,"a":0,"b":0,"c":0,"d":0,"name":"项目五"},
                {"value":0,"a":0,"b":0,"c":0,"d":0,"name":"项目六"},
                {"value":7,"a":2,"b":3,"c":4,"d":1,"name":"项目七"},
                {"value":0,"a":2,"b":3,"c":4,"d":1,"name":"项目八"},
                {"value":5,"a":2,"b":3,"c":4,"d":1,"name":"项目九"},
                {"value":0,"a":0,"b":0,"c":0,"d":0,"name":"项目十"}
            ]
        },
        {
            "name":"3月",
            "data":[
                {"value":0,"a":0,"b":0,"c":0,"d":0,"name":"项目一"},
                {"value":0,"a":0,"b":0,"c":0,"d":0,"name":"项目二"},
                {"value":0,"a":0,"b":0,"c":0,"d":0,"name":"项目三"},
                {"value":4,"a":2,"b":3,"c":4,"d":1,"name":"项目四"},
                {"value":0,"a":0,"b":0,"c":0,"d":0,"name":"项目五"},
                {"value":0,"a":0,"b":0,"c":0,"d":0,"name":"项目六"},
                {"value":7,"a":2,"b":3,"c":4,"d":1,"name":"项目七"},
                {"value":9,"a":2,"b":3,"c":4,"d":1,"name":"项目八"},
                {"value":14,"a":2,"b":3,"c":4,"d":1,"name":"项目九"},
                {"value":10,"a":2,"b":3,"c":4,"d":1,"name":"项目十"}
            ]
        },
        {
            "name":"4月",
            "data":[
                {"value":6,"a":2,"b":3,"c":4,"d":1,"name":"项目一"},
                {"value":8,"a":2,"b":3,"c":4,"d":1,"name":"项目二"},
                {"value":6,"a":2,"b":3,"c":4,"d":1,"name":"项目三"},
                {"value":4,"a":2,"b":3,"c":4,"d":1,"name":"项目四"},
                {"value":0,"a":0,"b":0,"c":0,"d":0,"name":"项目五"},
                {"value":0,"a":0,"b":0,"c":0,"d":0,"name":"项目六"},
                {"value":7,"a":2,"b":3,"c":4,"d":1,"name":"项目七"},
                {"value":9,"a":2,"b":3,"c":4,"d":1,"name":"项目八"},
                {"value":0,"a":0,"b":0,"c":0,"d":0,"name":"项目九"},
                {"value":6,"a":2,"b":3,"c":4,"d":1,"name":"项目十"}
            ]
        },
        {
            "name":"5月",
            "data":[
                {"value":10,"a":2,"b":3,"c":4,"d":1,"name":"项目一"},
                {"value":8,"a":2,"b":3,"c":4,"d":1,"name":"项目二"},
                {"value":6,"a":2,"b":3,"c":4,"d":1,"name":"项目三"},
                {"value":4,"a":2,"b":3,"c":4,"d":1,"name":"项目四"},
                {"value":0,"a":0,"b":0,"c":0,"d":0,"name":"项目五"},
                {"value":0,"a":0,"b":0,"c":0,"d":0,"name":"项目六"},
                {"value":7,"a":2,"b":3,"c":4,"d":1,"name":"项目七"},
                {"value":9,"a":2,"b":3,"c":4,"d":1,"name":"项目八"},
                {"value":11,"a":2,"b":3,"c":4,"d":1,"name":"项目九"},
                {"value":0,"a":0,"b":0,"c":0,"d":0,"name":"项目十"}
            ]
        },
        {
            "name":"6月",
            "data":[
                {"value":0,"a":0,"b":0,"c":0,"d":0,"name":"项目一"},
                {"value":8,"a":2,"b":3,"c":4,"d":1,"name":"项目二"},
                {"value":6,"a":2,"b":3,"c":4,"d":1,"name":"项目三"},
                {"value":4,"a":2,"b":3,"c":4,"d":1,"name":"项目四"},
                {"value":0,"a":0,"b":0,"c":0,"d":0,"name":"项目五"},
                {"value":0,"a":0,"b":0,"c":0,"d":0,"name":"项目六"},
                {"value":7,"a":2,"b":3,"c":4,"d":1,"name":"项目七"},
                {"value":9,"a":2,"b":3,"c":4,"d":1,"name":"项目八"},
                {"value":0,"a":0,"b":0,"c":0,"d":0,"name":"项目九"},
                {"value":10,"a":2,"b":3,"c":4,"d":1,"name":"项目十"}
            ]
        },
        {
            "name":"7月",
            "data":[
                {"value":11,"a":2,"b":3,"c":4,"d":1,"name":"项目一"},
                {"value":8,"a":2,"b":3,"c":4,"d":1,"name":"项目二"},
                {"value":6,"a":2,"b":3,"c":4,"d":1,"name":"项目三"},
                {"value":4,"a":2,"b":3,"c":4,"d":1,"name":"项目四"},
                {"value":0,"a":0,"b":0,"c":0,"d":0,"name":"项目五"},
                {"value":3,"a":2,"b":3,"c":4,"d":1,"name":"项目六"},
                {"value":7,"a":2,"b":3,"c":4,"d":1,"name":"项目七"},
                {"value":9,"a":2,"b":3,"c":4,"d":1,"name":"项目八"},
                {"value":0,"a":0,"b":0,"c":0,"d":0,"name":"项目九"},
                {"value":0,"a":0,"b":0,"c":0,"d":0,"name":"项目十"}
            ]
        },
        {
            "name":"8月",
            "data":[
                {"value":0,"a":0,"b":0,"c":0,"d":0,"name":"项目一"},
                {"value":8,"a":2,"b":3,"c":4,"d":1,"name":"项目二"},
                {"value":6,"a":2,"b":3,"c":4,"d":1,"name":"项目三"},
                {"value":4,"a":2,"b":3,"c":4,"d":1,"name":"项目四"},
                {"value":0,"a":0,"b":0,"c":0,"d":0,"name":"项目五"},
                {"value":4,"a":2,"b":3,"c":4,"d":1,"name":"项目六"},
                {"value":7,"a":2,"b":3,"c":4,"d":1,"name":"项目七"},
                {"value":9,"a":2,"b":3,"c":4,"d":1,"name":"项目八"},
                {"value":9,"a":2,"b":3,"c":4,"d":1,"name":"项目九"},
                {"value":0,"a":0,"b":0,"c":0,"d":0,"name":"项目十"}
            ]
        },
        {
            "name":"9月",
            "data":[
                {"value":10,"a":2,"b":3,"c":4,"d":1,"name":"项目一"},
                {"value":8,"a":2,"b":3,"c":4,"d":1,"name":"项目二"},
                {"value":0,"a":0,"b":0,"c":0,"d":0,"name":"项目三"},
                {"value":4,"a":2,"b":3,"c":4,"d":1,"name":"项目四"},
                {"value":0,"a":0,"b":0,"c":0,"d":0,"name":"项目五"},
                {"value":6,"a":2,"b":3,"c":4,"d":1,"name":"项目六"},
                {"value":7,"a":2,"b":3,"c":4,"d":1,"name":"项目七"},
                {"value":9,"a":2,"b":3,"c":4,"d":1,"name":"项目八"},
                {"value":0,"a":0,"b":0,"c":0,"d":0,"name":"项目九"},
                {"value":10,"a":2,"b":3,"c":4,"d":1,"name":"项目十"}
            ]
        },
        {
            "name":"10月",
            "data":[
                {"value":0,"a":0,"b":0,"c":0,"d":0,"name":"项目一"},
                {"value":8,"a":2,"b":3,"c":4,"d":1,"name":"项目二"},
                {"value":6,"a":2,"b":3,"c":4,"d":1,"name":"项目三"},
                {"value":4,"a":2,"b":3,"c":4,"d":1,"name":"项目四"},
                {"value":0,"a":0,"b":0,"c":0,"d":0,"name":"项目五"},
                {"value":10,"a":2,"b":3,"c":4,"d":1,"name":"项目六"},
                {"value":7,"a":2,"b":3,"c":4,"d":1,"name":"项目七"},
                {"value":9,"a":2,"b":3,"c":4,"d":1,"name":"项目八"},
                {"value":0,"a":0,"b":0,"c":0,"d":0,"name":"项目九"},
                {"value":10,"a":2,"b":3,"c":4,"d":1,"name":"项目十"}
            ]
        },
        {
            "name":"11月",
            "data":[
                {"value":9,"a":2,"b":3,"c":4,"d":1,"name":"项目一"},
                {"value":0,"a":0,"b":0,"c":0,"d":0,"name":"项目二"},
                {"value":6,"a":2,"b":3,"c":4,"d":1,"name":"项目三"},
                {"value":4,"a":2,"b":3,"c":4,"d":1,"name":"项目四"},
                {"value":0,"a":0,"b":0,"c":0,"d":0,"name":"项目五"},
                {"value":10,"a":2,"b":3,"c":4,"d":1,"name":"项目六"},
                {"value":7,"a":2,"b":3,"c":4,"d":1,"name":"项目七"},
                {"value":0,"a":0,"b":0,"c":0,"d":0,"name":"项目八"},
                {"value":9,"a":2,"b":3,"c":4,"d":1,"name":"项目九"},
                {"value":4,"a":2,"b":3,"c":4,"d":1,"name":"项目十"}
            ]
        },
        {
            "name":"12月",
            "data":[
                {"value":10,"a":2,"b":3,"c":4,"d":1,"name":"项目一"},
                {"value":8,"a":2,"b":3,"c":4,"d":1,"name":"项目二"},
                {"value":6,"a":2,"b":3,"c":4,"d":1,"name":"项目三"},
                {"value":4,"a":2,"b":3,"c":4,"d":1,"name":"项目四"},
                {"value":0,"a":0,"b":0,"c":0,"d":0,"name":"项目五"},
                {"value":0,"a":2,"b":3,"c":4,"d":1,"name":"项目六"},
                {"value":7,"a":2,"b":3,"c":4,"d":1,"name":"项目七"},
                {"value":9,"a":2,"b":3,"c":4,"d":1,"name":"项目八"},
                {"value":0,"a":0,"b":0,"c":0,"d":0,"name":"项目九"},
                {"value":11,"a":2,"b":3,"c":4,"d":1,"name":"项目十"}
            ]
        }
    ]
}

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

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

1.数据库的基本操作

SQL句子中语法格式提示&#xff1a; 1.中括号&#xff08;[]&#xff09;中的内容为可选项&#xff1b; 2.[&#xff0c;...]表示&#xff0c;前面的内容可重复&#xff1b; 3.大括号&#xff08;{}&#xff09;和竖线&#xff08;|&#xff09;表示选择项&#xff0c;在选择…

魏可伟受邀参加 2023 开放原子全球开源峰会

6月11日-13日&#xff0c;2023 开放原子全球开源峰会在京举行。作为开源行业年度盛事&#xff0c;本次峰会以“开源赋能&#xff0c;普惠未来”为主题&#xff0c;聚集政、产、学、研等各领域优势&#xff0c;汇聚顶尖大咖&#xff0c;共话开源未来。 KaiwuDB CTO 魏可伟受邀出…

Rancher的安装(k8s)

1、 Rancher概述 rancher官方文档 Rancher 是一个 Kubernetes 管理工具&#xff0c;让你能在任何地方和任何提供商上部署和运行集群。 Rancher 可以创建来自 Kubernetes 托管服务提供商的集群&#xff0c;创建节点并安装 Kubernetes&#xff0c;或者导入在任何地方运行的现有…

【总结笔记】Spring

1 Spring容器加载配置文件进行初始化。 Spring容器加载配置文件进行初始化主要有两种形式&#xff1a; 加载配置文件进行初始化&#xff1a; ClassPathXmlApplicationContext ctx new ClassPathXmlApplicationContext(“ApplicationContext.xml”); 加载配置类进行初始化&…

测试人如何打造简历化思维?三年经验软件测试简历分析

测试人如何打造简历化思维&#xff1f;如题&#xff0c;不是写如何打造简历&#xff0c;而是简历化思维&#xff0c;如何理解简历化思维&#xff1f; 很多人跟我说很累&#xff0c;不想干了&#xff0c;每天忙忙碌碌在给老板打工&#xff0c;年底老板又可以换法拉利了。 玩笑…

【探索 Kubernetes|容器基础进阶篇 系列 4】理解现代云原生时代的引擎

文章目录 系列文章目录&#x1f479; 关于作者一、前言|回顾二、静态和动态视图三、爆火的容器编排工具 Kubernetes 的诞生四、Kubernetes 要解决的问题是什么&#xff1f;五、理解 Kubernetes 全局架构图Master&#xff08;控制节点&#xff09;Node&#xff08;计算节点&…

Go语言小细节

Go语言小细节 结构体 结构体中允许存在匿名字段&#xff0c;即只有类型没有具体的变量名&#xff0c;但是一个结构体内只允许有一个相同类型的结构体中字段大写开头表示可公开访问&#xff0c;小写表示私有&#xff08;仅在当前结构体的包中可访问&#xff09;在编写结构体的…

Linux之进程信号(下)

文章目录 前言信号的相关概念一、信号的保存——位图1.内核中的表示2.信号集——sigset_t3.信号集操作函数 二、信号的捕捉过程1.内核态和用户态用户代码和内核代码如何分辨是用户态还是内核态一个进程如何跑到OS中执行方法 2.信号捕捉的过程 三、核心转储1.数组越界并不一定会…

CTFHub | 远程包含

0x00 前言 CTFHub 专注网络安全、信息安全、白帽子技术的在线学习&#xff0c;实训平台。提供优质的赛事及学习服务&#xff0c;拥有完善的题目环境及配套 writeup &#xff0c;降低 CTF 学习入门门槛&#xff0c;快速帮助选手成长&#xff0c;跟随主流比赛潮流。 0x01 题目描述…

Flutter 库:提升开发体验——Quick

Flutter 库&#xff1a;提升开发体验——Quick 文章目录 Flutter 库&#xff1a;提升开发体验——Quick一、概述1、简介2、功能3、官方资料4、思考 二、基本使用1、安装2、基本使用3、运行结果 三、List 列表扩展示例四、Map 映射扩展示例五、其它示例 一、概述 1、简介 Quic…

打印杨辉三角

这个公式&#xff0c;不好算&#xff0c;我觉得还是杨辉三角算起来方便&#xff1a;c#代码如下&#xff1a; double 打印杨辉三角(int n)//n必须是偶数&#xff0c;展开项是n1&#xff0c;中间项是n/2,此处返回中间项的概率202306131722 { //for (int i 0…

3个月面过字节测开岗,拿个20K不过分吧?

计算机专业&#xff0c;代码能力一般&#xff0c;之前有过两段实习以及一个学校项目经历。第一份实习是大二暑期在深圳的一家互联网公司做前端开发&#xff0c;第二份实习由于大三暑假回国的时间比较短&#xff08;小于两个月&#xff09;&#xff0c;于是找的实习是在一家初创…

浅聊一下 C#程序的 内存映射文件 玩法

一&#xff1a;背景 1. 讲故事 前段时间训练营里有朋友问 内存映射文件 是怎么玩的&#xff1f;说实话这东西理论我相信很多朋友都知道&#xff0c;就是将文件映射到进程的虚拟地址&#xff0c;说起来很容易&#xff0c;那如何让大家眼见为实呢&#xff1f;可能会难倒很多人&…

耗时3个月,线下访谈30+ csdn大佬,规划出了我的云原生学习路线

前言 大家好&#xff0c;我是沐风晓月&#xff0c;最近线下拜访不少云原生方向的大佬和csdn其他方向的大佬&#xff0c;受益匪浅。 于是在 5月23日&#xff0c;我定下来自己的目标&#xff1a; 我的目标&#xff1a; 可以说&#xff0c;这个世代给予的机遇&#xff0c;让我…

WWDC苹果高管脱口秀,Mike Rockwell透露Vision Pro开发的秘密

WWDC2023之后例行的“The Talk Show”脱口秀如期展开&#xff0c;深入讨论了WWDC上的一切。本次脱口秀分别谈及Mac游戏、Vision Pro以及操作系统和AI&#xff0c;由John Gruber主持&#xff0c;嘉宾包括&#xff1a;苹果技术发展部副总裁Mike Rockwell、以及Greg Joswiak、John…

上线客流人数统计系统实现资源的最大化利用

在流量管理方面&#xff0c;智慧客流采集系统的应用可以帮助商家实现资源的最大化利用。通过对客流量数据的分析&#xff0c;商家可以准确把握客流量变化规律&#xff0c;进而制定出最优化的资源配置方案。 AI客流视觉监控 一、某汽车4S店智慧客流采集系统案例展示 以某汽车4S…

人民大学中外合作办学_人大女王金融硕士——国际顶尖的金融硕士学位等你来拿

进入金融圈后&#xff0c;你会发现学历是筛选手段之一&#xff0c;之后的晋升更是看重学历。一个金融学士学位可以让你跨过门槛进入到金融行业&#xff0c;想要得到更好的发展&#xff0c;就需要从知识和证书等多方面进行提升了。辞职去攻读硕士学位不太现实&#xff0c;幸好遇…

vsftpd安装配置,Linux系统配置FTP服务器教程(CentOS 7)

vsftpd&#xff08;very secure FTP daemon&#xff09;是Linux下的一款小巧轻快、安全易用的FTP服务器软件。今天飞飞将和你分享Linux系统安装并配置vsftpd&#xff0c;搭建FTP环境。 先让我们来认识下FTP&#xff01; FTP&#xff08;File Transfer Protocol&#xff09;是一…

C语言-运算符

1 运算符的概念以及分类 运算符的概念 用运算符将运算对象(也称操作数&#xff09;连接起来的、符合&#xff23;语法规则的式子&#xff0c;称为&#xff23;表达式运算对象包括常量、变量、函数等 运算符的分类 1、双目运算符&#xff1a;即参加运算的操作数有两个 例&…

系统移植 网络环境配置和TFTP服务器搭建

目录 网络环境配置 1. 配置windows环境下协议 2. 配置linux环境下的网络 3. 开发板 4. Ping 不通解决办法 搭建TFTP服务器环境搭建 》1.验证tftp服务器环境是否搭建 》2.若是未安装&#xff0c;执行下面命令 》3.修改tftp服务器配置文件 》4.在ubuntu下创建工作目录并…