Echarts5.3.2可视化案例-布局篇(下)

简介: Echarts5.3.2可视化案例-布局篇00参考以及效果01背景知识大屏flex布局

CSS布局

```css
.panel {
    position: relative;
    height: 3.875rem;
    border: 1px solid rgba(25, 186, 139, 0.17);
    background: url(../images/line\(1\).png) rgba(255, 255, 255, 0.03);
    padding: 0 .1875rem .5rem ;
    margin-bottom: .1875rem;
    // 定义左上角的border
    &::before {
        position: absolute; // 子绝父相
        top: 0;
        left: 0;
        content: "";
        width: 10px;
        height: 10px;
        border-top: 2px solid #02a6b5;
        border-left: 2px solid #02a6b5;
      }
      &::after {
        position: absolute;
        top: 0;
        right: 0;
        content: "";
        width: 10px;
        height: 10px;
        border-top: 2px solid #02a6b5;
        border-right: 2px solid #02a6b5;
      }
    //  定义底部的样式
    .panel-footer {
        position: absolute;
        height: 1.25rem;
        // background-color: red;
        left: 0;
        bottom: 0;
        height: 15%;
        width: 100%;
        &::before {
          position: absolute;
          bottom: 0;
          left: 0;
          content: "";
          width: 10px;
          height: 10px;
          border-bottom: 2px solid #02a6b5;
          border-left: 2px solid #02a6b5;
        }
        &::after {
          position: absolute;
          bottom: 0;
          right: 0;
          content: "";
          width: 10px;
          height: 10px;
          border-bottom: 2px solid #02a6b5;
          border-right: 2px solid #02a6b5;
        }
    }   
    h2{
        height: .6rem;
        color: #fff;
        font-size: .25rem;
        font-weight: 400;
    }
    .chart {
        height: 3rem;
        background-color: beige;
    } 
}

截图:



07-左右布局

      <div class="panel bar">
                <h2>bar chart</h2>
                <div class="chart"> bar Echarts </div>
                <div class="panel-footer"></div>
            </div>

在左右的column中各复制3份即可

效果如下:


08-中间布局

  • 上面是no 数字模块
  • 下面是map 地图模块
  1. 数字模块 no 有个背景颜色 rgba(101, 132, 226, 0.1); 有个15像素的内边距
  2. 注意中间列 column 有个 左右 10px 下 15px 的外边距
  3. no 模块里面上下划分 上面是数字(no-hd) 下面 是 相关文字说明(no-bd)
  4. no-hd 数字模块 有一个边框 1px solid rgba(25, 186, 139, 0.17)
  5. no-hd 数字模块 里面分为两个小li 每个小li高度为 80px 文字大小为 70px 颜色为 #ffeb7b 字体是图标字体 electronicFont
  6. no-hd 利用 after 和 before制作2个小角, 边框 2px solid #02a6b5 宽度为 30px 高度为 10px
  7. 小竖线 给 第一个小li after 就可以 1px宽 背景颜色为 rgba(255, 255, 255, 0.2); 高度 50% top 25% 即可
  8. no-bd 里面也有两个小li 高度为 40px 文字颜色为 rgba(255, 255, 255, 0.7) 文字大小为 18px 上内边距为 10px

中间列的no模块布局

html布局

中间列的no模块布局
html布局
li {
    list-style: none;
  }
@font-face {
    font-family: electronicFont;
    src: url(../font/DS-DIGIT.TTF);
}
.no{
    background-color: rgba(101, 132, 226, 0.1);
    padding: 0.1875rem;
    .no-hd{
        position: relative;
        border: 1px solid rgba(25, 186, 139, 0.17);
        &::before {
            content: "";
            position: absolute;
            width: 30px;
            height: 10px;
            border-top: 2px solid #02a6b5;
            border-left: 2px solid #02a6b5;
            top: 0;
            left: 0;
          }
          &::after {
            content: "";
            position: absolute;
            width: 30px;
            height: 10px;
            border-bottom: 2px solid #02a6b5;
            border-right: 2px solid #02a6b5;
            right: 0;
            bottom: 0;
          }
          ul {
            display: flex;
            li {
              position: relative;
              flex: 1;
              text-align: center;
              height: 1rem;
              line-height: 1rem;
              font-size: 0.875rem;
              color: #ffeb7b;
              padding: 0.05rem 0;
              font-family: electronicFont;
              font-weight: bold;
              &:first-child::after {
                content: "";
                position: absolute;
                height: 50%;
                width: 1px;
                background: rgba(255, 255, 255, 0.2);
                right: 0;
                top: 25%;
              }
            }
          }
    }
    .no-bd ul {
        display: flex;
        li {
          flex: 1;
          height: 0.5rem;
          line-height: 0.5rem;
          text-align: center;
          font-size: 0.225rem;
          color: rgba(255, 255, 255, 0.7);
          padding-top: 0.125rem;
        }
      }
}

map模块配置

地图模块制作:

  1. 地图模块高度为 810px 里面包含4个盒子 chart 放图表模块 球体盒子 旋转1 旋转2
  2. 球体图片模块 map1 大小为 518px 要加背景图片 因为要缩放100% 定位到最中央 透明度 .3
  3. 旋转1 map 2 大小为 643px 要加背景图片 因为要缩放100% 定位到中央 透明度 .6 做旋转动画 利用z-index压住球体
  4. 旋转2 map3 大小为 566px 要加背景图片 因为要缩放100% 定位到中央 旋转动画 注意是逆时针

Html布局

        <!-- middle column -->
        <div class="column">
                <div class="no">
                <div class="no-hd">
                  <ul>
                    <li>125811</li>
                    <li>104563</li>
                  </ul>
                </div>
                <div class="no-bd">
                  <ul>
                    <li>前端需求人数</li>
                    <li>市场供应人数</li>
                  </ul>
                </div>
            </div>
              <div class="map">
                <div class="chart"></div>
                <div class="map1"></div>
                <div class="map2"></div>
                <div class="map3"></div>
            </div>
        </div>

CSS布局

.map{
    position: relative;
    height: 10.125rem;
    // background-color: #02a6b5;
    .chart{
        position: absolute;
        top: 0;
        left: 0;
        z-index: 5;
        height: 10.125rem;
        width: 100%;
    }
    .map1,
    .map2,
    .map3{
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%,-50%);
        width: 6.475rem;
        height: 6.475rem;
        background: url(../images/map.png) no-repeat;
        background-size: cover;
        opacity: 0.3;
        z-index: 1;
    }
    .map2 {
        width: 8.0375rem;
        height: 8.0375rem;
        background-image: url(../images/lbx.png);
        opacity: 0.6;
        animation: rotate 15s linear infinite;
        z-index: 2;
      }
    .map3 {
        width: 7.075rem;
        height: 7.075rem;
        background-image: url(../images/jt.png);
        animation: rotate1 10s linear infinite;
    }
    @keyframes rotate {
        from {
            transform: translate(-50%, -50%) rotate(0deg);
          }
          to {
            transform: translate(-50%, -50%) rotate(360deg);
          }
      }
      @keyframes rotate1 {
        from {
          transform: translate(-50%, -50%) rotate(0deg);
        }
        to {
          transform: translate(-50%, -50%) rotate(-360deg);
        }
    }
}
@media screen and (max-width: 1024px) {
    html {
      font-size: 42px !important;
    }
  }
  @media screen and (min-width: 1920) {
    html {
      font-size: 80px !important;
    }
  }

截图:


相关文章
|
5天前
|
存储 JavaScript 数据可视化
vue3+echarts应用——深度遍历html的dom结构并用树图进行可视化
vue3+echarts应用——深度遍历html的dom结构并用树图进行可视化
28 1
|
2天前
|
数据可视化 JavaScript 前端开发
Echarts是一个开源的JavaScript可视化库,用于创建各种类型的图表
Echarts是JavaScript的开源可视化库,Python通过Pyecharts库可调用它来绘制图表。示例展示了如何用Pyecharts创建柱状图:定义图表对象,设置标题和坐标轴,添加X轴、Y轴数据,最后渲染展示。Pyecharts还支持折线图、散点图、饼图等多种图表类型,更多详情可查阅官方文档。
14 0
|
5天前
|
新零售 分布式计算 数据可视化
数据分享|基于Python、Hadoop零售交易数据的Spark数据处理与Echarts可视化分析
数据分享|基于Python、Hadoop零售交易数据的Spark数据处理与Echarts可视化分析
16 0
|
5天前
|
数据采集 数据可视化 小程序
vue3+echarts可视化——记录我的2023编程之旅
vue3+echarts可视化——记录我的2023编程之旅
18 1
|
6天前
|
数据可视化 定位技术
selenuim&echarts——可视化分析csdn新星赛道选手展示头像、展示ip城市和断言参赛信息的有效性(进阶篇)(二)
selenuim&echarts——可视化分析csdn新星赛道选手展示头像、展示ip城市和断言参赛信息的有效性(进阶篇)
12 0
|
6天前
|
数据采集 JSON 自然语言处理
selenuim&echarts——可视化分析csdn新星赛道选手展示头像、展示ip城市和断言参赛信息的有效性(进阶篇)(一)
selenuim&echarts——可视化分析csdn新星赛道选手展示头像、展示ip城市和断言参赛信息的有效性(进阶篇)
12 0
selenuim&echarts——可视化分析csdn新星赛道选手展示头像、展示ip城市和断言参赛信息的有效性(进阶篇)(一)
|
2月前
|
数据可视化 前端开发
web前端-Echarts-5.3高级可视化和图表组合布局
web前端-Echarts-5.3高级可视化和图表组合布局
|
2月前
|
前端开发 JavaScript Apache
web前端-Echarts-5.3安装配置和案例
web前端-Echarts-5.3安装配置和案例
|
4月前
|
数据可视化
Echarts5.3.2可视化案例-时间轴动态柱形图
Echarts5.3.2可视化案例-时间轴动态柱形图
|
3月前
|
数据可视化
echarts图表坐标轴数据标签添加下划线
echarts图表坐标轴数据标签添加下划线
55 0