ECharts可视化大屏学习笔记【1】(整个结构布局搭建)

前言:仅作为学习笔记,防止忘掉(;へ:)

本节讲述整个项目基本布局的搭建

一、技术准备

完成该项目需要具备以下知识:

  • div + css 布局
  • flex 布局
  • Less
  • 原生js + jquery 使用
  • rem适配
  • echarts基础

二、案例适配方案

设计稿是1920px

  1. flexible.js 把屏幕分为 24 等份
  2. cssrem 插件的基准值是 80px
    插件-配置按钮—配置扩展设置–Root Font Size 里面 设置。 (但是别忘记重启vscode软件保证生效)

三、基本布局

在这里插入图片描述

1.header

基本要求:

  • 高度为100px
  • 背景图,在容器内显示
  • 缩放比例为 100%
  • h1 标题部分 白色 38像素 居中显示 行高为 80像素
  • 时间模块 showTime 定位右侧 right 为 30px 行高为 75px 文字颜色为:rgba(255, 255, 255, 0.7) 而文字大小为 20像素

2.mainbox 主体模块

基本要求:

  • 需要一个上左右的10px 的内边距
  • column 列容器,分三列,占比 3:5:3

css样式:

.mainbox {
  padding: 0.125rem 0.125rem 0;
  display: flex;
  .column {
    flex: 3;
  }
  &:nth-child(2) {
    flex: 5;
  }
}
1)panel公共模块

在这里插入图片描述
整体布局:

.panel {
  position: relative;
  height: 3.875rem;
  border: 1px solid rgba(25, 186, 139, 0.17);
  background: url(../images/line\(1\).png);
  padding: 0 0.1875rem 0.5rem;
  margin-bottom: 0.1875rem;
  // 四个角的样式设置
  &::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;
    left: 0;
    bottom: 0;
    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: 0.6rem;
    line-height: 0.6rem;
    text-align: center;
    color: #fff;
    font-size: 20px;
    font-weight: 400;
  }
  .chart {
    height: 3rem;
    background-color: pink;
  }
2)中间地图布局

在这里插入图片描述

  • 上面是no 数字模块
  • 下面是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% 定位到中央 旋转动画 注意是逆时针
<div class="column">
      <!-- 上方no模块制作 -->
      <div class="no">
        <div class="no-hd">
          <ul>
            <li>213455</li>
            <li>100000</li>
          </ul>
        </div>
        <div class="no-bd">
          <ul>
            <li>需求人数</li>
            <li>供用人数</li>
          </ul>
        </div>
      </div>
      <!-- 地图模块 -->
      <div class="map">
        <div class="map1"></div>
        <!-- 下面两个是旋转的图形 -->
        <div class="map2"></div>
        <div class="map3"></div>
        <div class="chart">ditu</div>
      </div>
    </div>

.map {
  position: relative;
  height: 10.125rem;
  .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: 100% 100%;
    opacity: 0.3;
  }
  .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);
    }
  }
}

四、初步布局效果

在这里插入图片描述
接下来会写图表的制作(但是是静态的)

  • 3
    点赞
  • 23
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
好的,以下是一个简单的 echarts 可视化大屏布局代码示例: ```html <!DOCTYPE html> <html> <head> <title>Echarts 可视化大屏</title> <meta charset="utf-8"> <!-- 引入 echarts.js --> <script src="https://cdn.staticfile.org/echarts/4.7.0/echarts.min.js"></script> <style> /* 样式表 */ body { margin: 0; padding: 0; font-family: Arial, sans-serif; } .header { background-color: #333; color: #fff; text-align: center; padding: 20px; } .container { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; height: calc(100vh - 80px); /* 确保容器高度充满整个屏幕 */ overflow: hidden; } .box { flex: 1; margin: 20px; background-color: #fff; box-shadow: 0 0 10px rgba(0,0,0,.1); border-radius: 5px; overflow: hidden; } h1 { margin-top: 0; padding: 20px; font-size: 24px; background-color: #333; color: #fff; } .chart { height: 60vh; padding: 20px; } </style> </head> <body> <header class="header"> <h1>Echarts 可视化大屏</h1> </header> <div class="container"> <div class="box"> <h1>图表1</h1> <div class="chart" id="chart1"></div> </div> <div class="box"> <h1>图表2</h1> <div class="chart" id="chart2"></div> </div> <div class="box"> <h1>图表3</h1> <div class="chart" id="chart3"></div> </div> <div class="box"> <h1>图表4</h1> <div class="chart" id="chart4"></div> </div> <div class="box"> <h1>图表5</h1> <div class="chart" id="chart5"></div> </div> <div class="box"> <h1>图表6</h1> <div class="chart" id="chart6"></div> </div> </div> <script> // 在这里编写 echarts 图表的代码 </script> </body> </html> ``` 请注意,这只是一个简单的示例,具体的 echarts 可视化大屏布局代码可能因需求而有所不同。在 `<script>` 标签中,您需要编写 echarts 图表的代码。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值