29-Vue之ECharts-散点图

news2024/11/26 22:51:19

ECharts-散点图

      • 前言
      • 散点图特点
      • 散点图实现步骤
      • 散点图常见效果
        • 气泡效果
        • 涟漪动画效果
      • 完整代码


前言

  • 本篇来学习散点图的实现

散点图特点

  • 散点图可以帮助我们推断出不同维度数据之间的相关性, 比如:看得出身高和体重是正相关, 身
    高越高, 体重越重
  • 散点图也经常用在地图的标注上

散点图实现步骤

  1. ECharts 最基本的代码结构
  2. 准备 x 轴和 y 轴的数据准备 x 轴和 y 轴的数据
  3. 准备配置项
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <!-- cdn方式 引入echarts.js文件 -->
  <script src="https://cdn.jsdelivr.net/npm/echarts@5.4.1/dist/echarts.min.js"></script>
</head>

<body>
  <div style="width: 600px;height:400px"></div>
  <script>
    //1. ECharts最基本的代码结构
    //2. x轴和y轴数据 二维数组 [ [身高,体重],...   ]
    //3. 将type的值设置为scatter, x轴和y轴的type都是value
    var data = [{ "gender": "female", "height": 161.2, "weight": 51.6 }, { "gender": "female", "height": 167.5, "weight": 59 }, { "gender": "female", "height": 159.5, "weight": 49.2 }, { "gender": "female", "height": 157, "weight": 63 }, { "gender": "female", "height": 155.8, "weight": 53.6 }, { "gender": "female", "height": 170, "weight": 59 }, { "gender": "female", "height": 159.1, "weight": 47.6 }, { "gender": "female", "height": 166, "weight": 69.8 }, { "gender": "female", "height": 176.2, "weight": 66.8 }, { "gender": "female", "height": 160.2, "weight": 75.2 }, { "gender": "female", "height": 172.5, "weight": 55.2 }, { "gender": "female", "height": 170.9, "weight": 54.2 }, { "gender": "female", "height": 172.9, "weight": 62.5 }, { "gender": "female", "height": 153.4, "weight": 42 }, { "gender": "female", "height": 160, "weight": 50 }, { "gender": "female", "height": 147.2, "weight": 49.8 }, { "gender": "female", "height": 168.2, "weight": 49.2 }, { "gender": "female", "height": 175, "weight": 73.2 }, { "gender": "female", "height": 157, "weight": 47.8 }, { "gender": "female", "height": 167.6, "weight": 68.8 }, { "gender": "female", "height": 159.5, "weight": 50.6 }, { "gender": "female", "height": 175, "weight": 82.5 }, { "gender": "female", "height": 166.8, "weight": 57.2 }, { "gender": "female", "height": 176.5, "weight": 87.8 }, { "gender": "female", "height": 170.2, "weight": 72.8 }, { "gender": "female", "height": 174, "weight": 54.5 }, { "gender": "female", "height": 173, "weight": 59.8 }, { "gender": "female", "height": 179.9, "weight": 67.3 }, { "gender": "female", "height": 170.5, "weight": 67.8 }, { "gender": "female", "height": 160, "weight": 47 }, { "gender": "female", "height": 154.4, "weight": 46.2 }, { "gender": "female", "height": 162, "weight": 55 }, { "gender": "female", "height": 176.5, "weight": 83 }, { "gender": "female", "height": 160, "weight": 54.4 }, { "gender": "female", "height": 152, "weight": 45.8 }, { "gender": "female", "height": 162.1, "weight": 53.6 }, { "gender": "female", "height": 170, "weight": 73.2 }, { "gender": "female", "height": 160.2, "weight": 52.1 }, { "gender": "female", "height": 161.3, "weight": 67.9 }, { "gender": "female", "height": 166.4, "weight": 56.6 }, { "gender": "female", "height": 168.9, "weight": 62.3 }, { "gender": "female", "height": 163.8, "weight": 58.5 }, { "gender": "female", "height": 167.6, "weight": 54.5 }, { "gender": "female", "height": 160, "weight": 50.2 }, { "gender": "female", "height": 161.3, "weight": 60.3 }, { "gender": "female", "height": 167.6, "weight": 58.3 }, { "gender": "female", "height": 165.1, "weight": 56.2 }, { "gender": "female", "height": 160, "weight": 50.2 }, { "gender": "female", "height": 170, "weight": 72.9 }, { "gender": "female", "height": 157.5, "weight": 59.8 }, { "gender": "female", "height": 167.6, "weight": 61 }, { "gender": "female", "height": 160.7, "weight": 69.1 }, { "gender": "female", "height": 163.2, "weight": 55.9 }, { "gender": "female", "height": 152.4, "weight": 46.5 }, { "gender": "female", "height": 157.5, "weight": 54.3 }, { "gender": "female", "height": 168.3, "weight": 54.8 }, { "gender": "female", "height": 180.3, "weight": 60.7 }, { "gender": "female", "height": 165.5, "weight": 60 }, { "gender": "female", "height": 165, "weight": 62 }, { "gender": "female", "height": 164.5, "weight": 60.3 }, { "gender": "female", "height": 156, "weight": 52.7 }, { "gender": "female", "height": 160, "weight": 74.3 }, { "gender": "female", "height": 163, "weight": 62 }, { "gender": "female", "height": 165.7, "weight": 73.1 }, { "gender": "female", "height": 161, "weight": 80 }, { "gender": "female", "height": 162, "weight": 54.7 }, { "gender": "female", "height": 166, "weight": 53.2 }, { "gender": "female", "height": 174, "weight": 75.7 }, { "gender": "female", "height": 172.7, "weight": 61.1 }, { "gender": "female", "height": 167.6, "weight": 55.7 }, { "gender": "female", "height": 151.1, "weight": 48.7 }, { "gender": "female", "height": 164.5, "weight": 52.3 }, { "gender": "female", "height": 163.5, "weight": 50 }, { "gender": "female", "height": 152, "weight": 59.3 }, { "gender": "female", "height": 169, "weight": 62.5 }, { "gender": "female", "height": 164, "weight": 55.7 }, { "gender": "female", "height": 161.2, "weight": 54.8 }, { "gender": "female", "height": 155, "weight": 45.9 }, { "gender": "female", "height": 170, "weight": 70.6 }, { "gender": "female", "height": 176.2, "weight": 67.2 }, { "gender": "female", "height": 170, "weight": 69.4 }, { "gender": "female", "height": 162.5, "weight": 58.2 }, { "gender": "female", "height": 170.3, "weight": 64.8 }, { "gender": "female", "height": 164.1, "weight": 71.6 }, { "gender": "female", "height": 169.5, "weight": 52.8 }, { "gender": "female", "height": 163.2, "weight": 59.8 }, { "gender": "female", "height": 154.5, "weight": 49 }, { "gender": "female", "height": 159.8, "weight": 50 }, { "gender": "female", "height": 173.2, "weight": 69.2 }, { "gender": "female", "height": 170, "weight": 55.9 }, { "gender": "female", "height": 161.4, "weight": 63.4 }, { "gender": "female", "height": 169, "weight": 58.2 }, { "gender": "female", "height": 166.2, "weight": 58.6 }, { "gender": "female", "height": 159.4, "weight": 45.7 }, { "gender": "female", "height": 162.5, "weight": 52.2 }, { "gender": "female", "height": 159, "weight": 48.6 }, { "gender": "female", "height": 162.8, "weight": 57.8 }, { "gender": "female", "height": 159, "weight": 55.6 }, { "gender": "female", "height": 179.8, "weight": 66.8 }, { "gender": "female", "height": 162.9, "weight": 59.4 }, { "gender": "female", "height": 161, "weight": 53.6 }, { "gender": "female", "height": 151.1, "weight": 73.2 }, { "gender": "female", "height": 168.2, "weight": 53.4 }, { "gender": "female", "height": 168.9, "weight": 69 }, { "gender": "female", "height": 173.2, "weight": 58.4 }, { "gender": "female", "height": 171.8, "weight": 56.2 }, { "gender": "female", "height": 178, "weight": 70.6 }, { "gender": "female", "height": 164.3, "weight": 59.8 }, { "gender": "female", "height": 163, "weight": 72 }, { "gender": "female", "height": 168.5, "weight": 65.2 }, { "gender": "female", "height": 166.8, "weight": 56.6 }, { "gender": "female", "height": 172.7, "weight": 105.2 }, { "gender": "female", "height": 163.5, "weight": 51.8 }, { "gender": "female", "height": 169.4, "weight": 63.4 }, { "gender": "female", "height": 167.8, "weight": 59 }, { "gender": "female", "height": 159.5, "weight": 47.6 }, { "gender": "female", "height": 167.6, "weight": 63 }, { "gender": "female", "height": 161.2, "weight": 55.2 }, { "gender": "female", "height": 160, "weight": 45 }, { "gender": "female", "height": 163.2, "weight": 54 }, { "gender": "female", "height": 162.2, "weight": 50.2 }, { "gender": "female", "height": 161.3, "weight": 60.2 }, { "gender": "female", "height": 149.5, "weight": 44.8 }, { "gender": "female", "height": 157.5, "weight": 58.8 }, { "gender": "female", "height": 163.2, "weight": 56.4 }, { "gender": "female", "height": 172.7, "weight": 62 }, { "gender": "female", "height": 155, "weight": 49.2 }, { "gender": "female", "height": 156.5, "weight": 67.2 }, { "gender": "female", "height": 164, "weight": 53.8 }, { "gender": "female", "height": 160.9, "weight": 54.4 }, { "gender": "female", "height": 162.8, "weight": 58 }, { "gender": "female", "height": 167, "weight": 59.8 }, { "gender": "female", "height": 160, "weight": 54.8 }, { "gender": "female", "height": 160, "weight": 43.2 }, { "gender": "female", "height": 168.9, "weight": 60.5 }, { "gender": "female", "height": 158.2, "weight": 46.4 }, { "gender": "female", "height": 156, "weight": 64.4 }, { "gender": "female", "height": 160, "weight": 48.8 }, { "gender": "female", "height": 167.1, "weight": 62.2 }, { "gender": "female", "height": 158, "weight": 55.5 }, { "gender": "female", "height": 167.6, "weight": 57.8 }, { "gender": "female", "height": 156, "weight": 54.6 }, { "gender": "female", "height": 162.1, "weight": 59.2 }, { "gender": "female", "height": 173.4, "weight": 52.7 }, { "gender": "female", "height": 159.8, "weight": 53.2 }, { "gender": "female", "height": 170.5, "weight": 64.5 }, { "gender": "female", "height": 159.2, "weight": 51.8 }, { "gender": "female", "height": 157.5, "weight": 56 }, { "gender": "female", "height": 161.3, "weight": 63.6 }, { "gender": "female", "height": 162.6, "weight": 63.2 }, { "gender": "female", "height": 160, "weight": 59.5 }, { "gender": "female", "height": 168.9, "weight": 56.8 }, { "gender": "female", "height": 165.1, "weight": 64.1 }, { "gender": "female", "height": 162.6, "weight": 50 }, { "gender": "female", "height": 165.1, "weight": 72.3 }, { "gender": "female", "height": 166.4, "weight": 55 }, { "gender": "female", "height": 160, "weight": 55.9 }, { "gender": "female", "height": 152.4, "weight": 60.4 }, { "gender": "female", "height": 170.2, "weight": 69.1 }, { "gender": "female", "height": 162.6, "weight": 84.5 }, { "gender": "female", "height": 170.2, "weight": 55.9 }, { "gender": "female", "height": 158.8, "weight": 55.5 }, { "gender": "female", "height": 172.7, "weight": 69.5 }, { "gender": "female", "height": 167.6, "weight": 76.4 }, { "gender": "female", "height": 162.6, "weight": 61.4 }, { "gender": "female", "height": 167.6, "weight": 65.9 }, { "gender": "female", "height": 156.2, "weight": 58.6 }, { "gender": "female", "height": 175.2, "weight": 66.8 }, { "gender": "female", "height": 172.1, "weight": 56.6 }, { "gender": "female", "height": 162.6, "weight": 58.6 }, { "gender": "female", "height": 160, "weight": 55.9 }, { "gender": "female", "height": 165.1, "weight": 59.1 }, { "gender": "female", "height": 182.9, "weight": 81.8 }, { "gender": "female", "height": 166.4, "weight": 70.7 }, { "gender": "female", "height": 165.1, "weight": 56.8 }, { "gender": "female", "height": 177.8, "weight": 60 }, { "gender": "female", "height": 165.1, "weight": 58.2 }, { "gender": "female", "height": 175.3, "weight": 72.7 }, { "gender": "female", "height": 154.9, "weight": 54.1 }, { "gender": "female", "height": 158.8, "weight": 49.1 }, { "gender": "female", "height": 172.7, "weight": 75.9 }, { "gender": "female", "height": 168.9, "weight": 55 }, { "gender": "female", "height": 161.3, "weight": 57.3 }, { "gender": "female", "height": 167.6, "weight": 55 }, { "gender": "female", "height": 165.1, "weight": 65.5 }, { "gender": "female", "height": 175.3, "weight": 65.5 }, { "gender": "female", "height": 157.5, "weight": 48.6 }, { "gender": "female", "height": 163.8, "weight": 58.6 }, { "gender": "female", "height": 167.6, "weight": 63.6 }, { "gender": "female", "height": 165.1, "weight": 55.2 }, { "gender": "female", "height": 165.1, "weight": 62.7 }, { "gender": "female", "height": 168.9, "weight": 56.6 }, { "gender": "female", "height": 162.6, "weight": 53.9 }, { "gender": "female", "height": 164.5, "weight": 63.2 }, { "gender": "female", "height": 176.5, "weight": 73.6 }, { "gender": "female", "height": 168.9, "weight": 62 }, { "gender": "female", "height": 175.3, "weight": 63.6 }, { "gender": "female", "height": 159.4, "weight": 53.2 }, { "gender": "female", "height": 160, "weight": 53.4 }, { "gender": "female", "height": 170.2, "weight": 55 }, { "gender": "female", "height": 162.6, "weight": 70.5 }, { "gender": "female", "height": 167.6, "weight": 54.5 }, { "gender": "female", "height": 162.6, "weight": 54.5 }, { "gender": "female", "height": 160.7, "weight": 55.9 }, { "gender": "female", "height": 160, "weight": 59 }, { "gender": "female", "height": 157.5, "weight": 63.6 }, { "gender": "female", "height": 162.6, "weight": 54.5 }, { "gender": "female", "height": 152.4, "weight": 47.3 }, { "gender": "female", "height": 170.2, "weight": 67.7 }, { "gender": "female", "height": 165.1, "weight": 80.9 }, { "gender": "female", "height": 172.7, "weight": 70.5 }, { "gender": "female", "height": 165.1, "weight": 60.9 }, { "gender": "female", "height": 170.2, "weight": 63.6 }, { "gender": "female", "height": 170.2, "weight": 54.5 }, { "gender": "female", "height": 170.2, "weight": 59.1 }, { "gender": "female", "height": 161.3, "weight": 70.5 }, { "gender": "female", "height": 167.6, "weight": 52.7 }, { "gender": "female", "height": 167.6, "weight": 62.7 }, { "gender": "female", "height": 165.1, "weight": 86.3 }, { "gender": "female", "height": 162.6, "weight": 66.4 }, { "gender": "female", "height": 152.4, "weight": 67.3 }, { "gender": "female", "height": 168.9, "weight": 63 }, { "gender": "female", "height": 170.2, "weight": 73.6 }, { "gender": "female", "height": 175.2, "weight": 62.3 }, { "gender": "female", "height": 175.2, "weight": 57.7 }, { "gender": "female", "height": 160, "weight": 55.4 }, { "gender": "female", "height": 165.1, "weight": 104.1 }, { "gender": "female", "height": 174, "weight": 55.5 }, { "gender": "female", "height": 170.2, "weight": 77.3 }, { "gender": "female", "height": 160, "weight": 80.5 }, { "gender": "female", "height": 167.6, "weight": 64.5 }, { "gender": "female", "height": 167.6, "weight": 72.3 }, { "gender": "female", "height": 167.6, "weight": 61.4 }, { "gender": "female", "height": 154.9, "weight": 58.2 }, { "gender": "female", "height": 162.6, "weight": 81.8 }, { "gender": "female", "height": 175.3, "weight": 63.6 }, { "gender": "female", "height": 171.4, "weight": 53.4 }, { "gender": "female", "height": 157.5, "weight": 54.5 }, { "gender": "female", "height": 165.1, "weight": 53.6 }, { "gender": "female", "height": 160, "weight": 60 }, { "gender": "female", "height": 174, "weight": 73.6 }, { "gender": "female", "height": 162.6, "weight": 61.4 }, { "gender": "female", "height": 174, "weight": 55.5 }, { "gender": "female", "height": 162.6, "weight": 63.6 }, { "gender": "female", "height": 161.3, "weight": 60.9 }, { "gender": "female", "height": 156.2, "weight": 60 }, { "gender": "female", "height": 149.9, "weight": 46.8 }, { "gender": "female", "height": 169.5, "weight": 57.3 }, { "gender": "female", "height": 160, "weight": 64.1 }, { "gender": "female", "height": 175.3, "weight": 63.6 }, { "gender": "female", "height": 169.5, "weight": 67.3 }, { "gender": "female", "height": 160, "weight": 75.5 }, { "gender": "female", "height": 172.7, "weight": 68.2 }, { "gender": "female", "height": 162.6, "weight": 61.4 }, { "gender": "female", "height": 157.5, "weight": 76.8 }, { "gender": "female", "height": 176.5, "weight": 71.8 }, { "gender": "female", "height": 164.4, "weight": 55.5 }, { "gender": "female", "height": 160.7, "weight": 48.6 }, { "gender": "female", "height": 174, "weight": 66.4 }, { "gender": "female", "height": 163.8, "weight": 67.3 }, { "gender": "male", "height": 174, "weight": 65.6 }, { "gender": "male", "height": 175.3, "weight": 71.8 }, { "gender": "male", "height": 193.5, "weight": 80.7 }, { "gender": "male", "height": 186.5, "weight": 72.6 }, { "gender": "male", "height": 187.2, "weight": 78.8 }, { "gender": "male", "height": 181.5, "weight": 74.8 }, { "gender": "male", "height": 184, "weight": 86.4 }, { "gender": "male", "height": 184.5, "weight": 78.4 }, { "gender": "male", "height": 175, "weight": 62 }, { "gender": "male", "height": 184, "weight": 81.6 }, { "gender": "male", "height": 180, "weight": 76.6 }, { "gender": "male", "height": 177.8, "weight": 83.6 }, { "gender": "male", "height": 192, "weight": 90 }, { "gender": "male", "height": 176, "weight": 74.6 }, { "gender": "male", "height": 174, "weight": 71 }, { "gender": "male", "height": 184, "weight": 79.6 }, { "gender": "male", "height": 192.7, "weight": 93.8 }, { "gender": "male", "height": 171.5, "weight": 70 }, { "gender": "male", "height": 173, "weight": 72.4 }, { "gender": "male", "height": 176, "weight": 85.9 }, { "gender": "male", "height": 176, "weight": 78.8 }, { "gender": "male", "height": 180.5, "weight": 77.8 }, { "gender": "male", "height": 172.7, "weight": 66.2 }, { "gender": "male", "height": 176, "weight": 86.4 }, { "gender": "male", "height": 173.5, "weight": 81.8 }, { "gender": "male", "height": 178, "weight": 89.6 }, { "gender": "male", "height": 180.3, "weight": 82.8 }, { "gender": "male", "height": 180.3, "weight": 76.4 }, { "gender": "male", "height": 164.5, "weight": 63.2 }, { "gender": "male", "height": 173, "weight": 60.9 }, { "gender": "male", "height": 183.5, "weight": 74.8 }, { "gender": "male", "height": 175.5, "weight": 70 }, { "gender": "male", "height": 188, "weight": 72.4 }, { "gender": "male", "height": 189.2, "weight": 84.1 }, { "gender": "male", "height": 172.8, "weight": 69.1 }, { "gender": "male", "height": 170, "weight": 59.5 }, { "gender": "male", "height": 182, "weight": 67.2 }, { "gender": "male", "height": 170, "weight": 61.3 }, { "gender": "male", "height": 177.8, "weight": 68.6 }, { "gender": "male", "height": 184.2, "weight": 80.1 }, { "gender": "male", "height": 186.7, "weight": 87.8 }, { "gender": "male", "height": 171.4, "weight": 84.7 }, { "gender": "male", "height": 172.7, "weight": 73.4 }, { "gender": "male", "height": 175.3, "weight": 72.1 }, { "gender": "male", "height": 180.3, "weight": 82.6 }, { "gender": "male", "height": 182.9, "weight": 88.7 }, { "gender": "male", "height": 188, "weight": 84.1 }, { "gender": "male", "height": 177.2, "weight": 94.1 }, { "gender": "male", "height": 172.1, "weight": 74.9 }, { "gender": "male", "height": 167, "weight": 59.1 }, { "gender": "male", "height": 169.5, "weight": 75.6 }, { "gender": "male", "height": 174, "weight": 86.2 }, { "gender": "male", "height": 172.7, "weight": 75.3 }, { "gender": "male", "height": 182.2, "weight": 87.1 }, { "gender": "male", "height": 164.1, "weight": 55.2 }, { "gender": "male", "height": 163, "weight": 57 }, { "gender": "male", "height": 171.5, "weight": 61.4 }, { "gender": "male", "height": 184.2, "weight": 76.8 }, { "gender": "male", "height": 174, "weight": 86.8 }, { "gender": "male", "height": 174, "weight": 72.2 }, { "gender": "male", "height": 177, "weight": 71.6 }, { "gender": "male", "height": 186, "weight": 84.8 }, { "gender": "male", "height": 167, "weight": 68.2 }, { "gender": "male", "height": 171.8, "weight": 66.1 }, { "gender": "male", "height": 182, "weight": 72 }, { "gender": "male", "height": 167, "weight": 64.6 }, { "gender": "male", "height": 177.8, "weight": 74.8 }, { "gender": "male", "height": 164.5, "weight": 70 }, { "gender": "male", "height": 192, "weight": 101.6 }, { "gender": "male", "height": 175.5, "weight": 63.2 }, { "gender": "male", "height": 171.2, "weight": 79.1 }, { "gender": "male", "height": 181.6, "weight": 78.9 }, { "gender": "male", "height": 167.4, "weight": 67.7 }, { "gender": "male", "height": 181.1, "weight": 66 }, { "gender": "male", "height": 177, "weight": 68.2 }, { "gender": "male", "height": 174.5, "weight": 63.9 }, { "gender": "male", "height": 177.5, "weight": 72 }, { "gender": "male", "height": 170.5, "weight": 56.8 }, { "gender": "male", "height": 182.4, "weight": 74.5 }, { "gender": "male", "height": 197.1, "weight": 90.9 }, { "gender": "male", "height": 180.1, "weight": 93 }, { "gender": "male", "height": 175.5, "weight": 80.9 }, { "gender": "male", "height": 180.6, "weight": 72.7 }, { "gender": "male", "height": 184.4, "weight": 68 }, { "gender": "male", "height": 175.5, "weight": 70.9 }, { "gender": "male", "height": 180.6, "weight": 72.5 }, { "gender": "male", "height": 177, "weight": 72.5 }, { "gender": "male", "height": 177.1, "weight": 83.4 }, { "gender": "male", "height": 181.6, "weight": 75.5 }, { "gender": "male", "height": 176.5, "weight": 73 }, { "gender": "male", "height": 175, "weight": 70.2 }, { "gender": "male", "height": 174, "weight": 73.4 }, { "gender": "male", "height": 165.1, "weight": 70.5 }, { "gender": "male", "height": 177, "weight": 68.9 }, { "gender": "male", "height": 192, "weight": 102.3 }, { "gender": "male", "height": 176.5, "weight": 68.4 }, { "gender": "male", "height": 169.4, "weight": 65.9 }, { "gender": "male", "height": 182.1, "weight": 75.7 }, { "gender": "male", "height": 179.8, "weight": 84.5 }, { "gender": "male", "height": 175.3, "weight": 87.7 }, { "gender": "male", "height": 184.9, "weight": 86.4 }, { "gender": "male", "height": 177.3, "weight": 73.2 }, { "gender": "male", "height": 167.4, "weight": 53.9 }, { "gender": "male", "height": 178.1, "weight": 72 }, { "gender": "male", "height": 168.9, "weight": 55.5 }, { "gender": "male", "height": 157.2, "weight": 58.4 }, { "gender": "male", "height": 180.3, "weight": 83.2 }, { "gender": "male", "height": 170.2, "weight": 72.7 }, { "gender": "male", "height": 177.8, "weight": 64.1 }, { "gender": "male", "height": 172.7, "weight": 72.3 }, { "gender": "male", "height": 165.1, "weight": 65 }, { "gender": "male", "height": 186.7, "weight": 86.4 }, { "gender": "male", "height": 165.1, "weight": 65 }, { "gender": "male", "height": 174, "weight": 88.6 }, { "gender": "male", "height": 175.3, "weight": 84.1 }, { "gender": "male", "height": 185.4, "weight": 66.8 }, { "gender": "male", "height": 177.8, "weight": 75.5 }, { "gender": "male", "height": 180.3, "weight": 93.2 }, { "gender": "male", "height": 180.3, "weight": 82.7 }, { "gender": "male", "height": 177.8, "weight": 58 }, { "gender": "male", "height": 177.8, "weight": 79.5 }, { "gender": "male", "height": 177.8, "weight": 78.6 }, { "gender": "male", "height": 177.8, "weight": 71.8 }, { "gender": "male", "height": 177.8, "weight": 116.4 }, { "gender": "male", "height": 163.8, "weight": 72.2 }, { "gender": "male", "height": 188, "weight": 83.6 }, { "gender": "male", "height": 198.1, "weight": 85.5 }, { "gender": "male", "height": 175.3, "weight": 90.9 }, { "gender": "male", "height": 166.4, "weight": 85.9 }, { "gender": "male", "height": 190.5, "weight": 89.1 }, { "gender": "male", "height": 166.4, "weight": 75 }, { "gender": "male", "height": 177.8, "weight": 77.7 }, { "gender": "male", "height": 179.7, "weight": 86.4 }, { "gender": "male", "height": 172.7, "weight": 90.9 }, { "gender": "male", "height": 190.5, "weight": 73.6 }, { "gender": "male", "height": 185.4, "weight": 76.4 }, { "gender": "male", "height": 168.9, "weight": 69.1 }, { "gender": "male", "height": 167.6, "weight": 84.5 }, { "gender": "male", "height": 175.3, "weight": 64.5 }, { "gender": "male", "height": 170.2, "weight": 69.1 }, { "gender": "male", "height": 190.5, "weight": 108.6 }, { "gender": "male", "height": 177.8, "weight": 86.4 }, { "gender": "male", "height": 190.5, "weight": 80.9 }, { "gender": "male", "height": 177.8, "weight": 87.7 }, { "gender": "male", "height": 184.2, "weight": 94.5 }, { "gender": "male", "height": 176.5, "weight": 80.2 }, { "gender": "male", "height": 177.8, "weight": 72 }, { "gender": "male", "height": 180.3, "weight": 71.4 }, { "gender": "male", "height": 171.4, "weight": 72.7 }, { "gender": "male", "height": 172.7, "weight": 84.1 }, { "gender": "male", "height": 172.7, "weight": 76.8 }, { "gender": "male", "height": 177.8, "weight": 63.6 }, { "gender": "male", "height": 177.8, "weight": 80.9 }, { "gender": "male", "height": 182.9, "weight": 80.9 }, { "gender": "male", "height": 170.2, "weight": 85.5 }, { "gender": "male", "height": 167.6, "weight": 68.6 }, { "gender": "male", "height": 175.3, "weight": 67.7 }, { "gender": "male", "height": 165.1, "weight": 66.4 }, { "gender": "male", "height": 185.4, "weight": 102.3 }, { "gender": "male", "height": 181.6, "weight": 70.5 }, { "gender": "male", "height": 172.7, "weight": 95.9 }, { "gender": "male", "height": 190.5, "weight": 84.1 }, { "gender": "male", "height": 179.1, "weight": 87.3 }, { "gender": "male", "height": 175.3, "weight": 71.8 }, { "gender": "male", "height": 170.2, "weight": 65.9 }, { "gender": "male", "height": 193, "weight": 95.9 }, { "gender": "male", "height": 171.4, "weight": 91.4 }, { "gender": "male", "height": 177.8, "weight": 81.8 }, { "gender": "male", "height": 177.8, "weight": 96.8 }, { "gender": "male", "height": 167.6, "weight": 69.1 }, { "gender": "male", "height": 167.6, "weight": 82.7 }, { "gender": "male", "height": 180.3, "weight": 75.5 }, { "gender": "male", "height": 182.9, "weight": 79.5 }, { "gender": "male", "height": 176.5, "weight": 73.6 }, { "gender": "male", "height": 186.7, "weight": 91.8 }, { "gender": "male", "height": 188, "weight": 84.1 }, { "gender": "male", "height": 188, "weight": 85.9 }, { "gender": "male", "height": 177.8, "weight": 81.8 }, { "gender": "male", "height": 174, "weight": 82.5 }, { "gender": "male", "height": 177.8, "weight": 80.5 }, { "gender": "male", "height": 171.4, "weight": 70 }, { "gender": "male", "height": 185.4, "weight": 81.8 }, { "gender": "male", "height": 185.4, "weight": 84.1 }, { "gender": "male", "height": 188, "weight": 90.5 }, { "gender": "male", "height": 188, "weight": 91.4 }, { "gender": "male", "height": 182.9, "weight": 89.1 }, { "gender": "male", "height": 176.5, "weight": 85 }, { "gender": "male", "height": 175.3, "weight": 69.1 }, { "gender": "male", "height": 175.3, "weight": 73.6 }, { "gender": "male", "height": 188, "weight": 80.5 }, { "gender": "male", "height": 188, "weight": 82.7 }, { "gender": "male", "height": 175.3, "weight": 86.4 }, { "gender": "male", "height": 170.5, "weight": 67.7 }, { "gender": "male", "height": 179.1, "weight": 92.7 }, { "gender": "male", "height": 177.8, "weight": 93.6 }, { "gender": "male", "height": 175.3, "weight": 70.9 }, { "gender": "male", "height": 182.9, "weight": 75 }, { "gender": "male", "height": 170.8, "weight": 93.2 }, { "gender": "male", "height": 188, "weight": 93.2 }, { "gender": "male", "height": 180.3, "weight": 77.7 }, { "gender": "male", "height": 177.8, "weight": 61.4 }, { "gender": "male", "height": 185.4, "weight": 94.1 }, { "gender": "male", "height": 168.9, "weight": 75 }, { "gender": "male", "height": 185.4, "weight": 83.6 }, { "gender": "male", "height": 180.3, "weight": 85.5 }, { "gender": "male", "height": 174, "weight": 73.9 }, { "gender": "male", "height": 167.6, "weight": 66.8 }, { "gender": "male", "height": 182.9, "weight": 87.3 }, { "gender": "male", "height": 160, "weight": 72.3 }, { "gender": "male", "height": 180.3, "weight": 88.6 }, { "gender": "male", "height": 167.6, "weight": 75.5 }, { "gender": "male", "height": 186.7, "weight": 101.4 }, { "gender": "male", "height": 175.3, "weight": 91.1 }, { "gender": "male", "height": 175.3, "weight": 67.3 }, { "gender": "male", "height": 175.9, "weight": 77.7 }, { "gender": "male", "height": 175.3, "weight": 81.8 }, { "gender": "male", "height": 179.1, "weight": 75.5 }, { "gender": "male", "height": 181.6, "weight": 84.5 }, { "gender": "male", "height": 177.8, "weight": 76.6 }, { "gender": "male", "height": 182.9, "weight": 85 }, { "gender": "male", "height": 177.8, "weight": 102.5 }, { "gender": "male", "height": 184.2, "weight": 77.3 }, { "gender": "male", "height": 179.1, "weight": 71.8 }, { "gender": "male", "height": 176.5, "weight": 87.9 }, { "gender": "male", "height": 188, "weight": 94.3 }, { "gender": "male", "height": 174, "weight": 70.9 }, { "gender": "male", "height": 167.6, "weight": 64.5 }, { "gender": "male", "height": 170.2, "weight": 77.3 }, { "gender": "male", "height": 167.6, "weight": 72.3 }, { "gender": "male", "height": 188, "weight": 87.3 }, { "gender": "male", "height": 174, "weight": 80 }, { "gender": "male", "height": 176.5, "weight": 82.3 }, { "gender": "male", "height": 180.3, "weight": 73.6 }, { "gender": "male", "height": 167.6, "weight": 74.1 }, { "gender": "male", "height": 188, "weight": 85.9 }, { "gender": "male", "height": 180.3, "weight": 73.2 }, { "gender": "male", "height": 167.6, "weight": 76.3 }, { "gender": "male", "height": 183, "weight": 65.9 }, { "gender": "male", "height": 183, "weight": 90.9 }, { "gender": "male", "height": 179.1, "weight": 89.1 }, { "gender": "male", "height": 170.2, "weight": 62.3 }, { "gender": "male", "height": 177.8, "weight": 82.7 }, { "gender": "male", "height": 179.1, "weight": 79.1 }, { "gender": "male", "height": 190.5, "weight": 98.2 }, { "gender": "male", "height": 177.8, "weight": 84.1 }, { "gender": "male", "height": 180.3, "weight": 83.2 }, { "gender": "male", "height": 180.3, "weight": 83.2 }]
    var axisData = []
    for( var i=0;i<data.length;i++) {
      var height = data[i].height
      var weight = data[i].weight
      var newArr = [height, weight]
      axisData.push(newArr)
    }
    console.log(axisData)
    var mCharts = echarts.init(document.querySelector("div"))
    var option = {
      xAxis: {
        type: 'value',
        scale: true
      },
      yAxis: {
        type: 'value',
        scale: true
      },
      series: [
        {
          type: 'scatter', // 指明图表的类型为散点图
          data: axisData
        }
      ]
    }
    mCharts.setOption(option)
  </script>
</body>
</html>
  • 效果
    在这里插入图片描述

散点图常见效果

气泡效果

var option = {
  series: [
   {
      type: 'scatter',
      data: axisData,
      symbolSize: 25,
      itemStyle: {
        color: 'green',
     }
   }
 ]
}

在这里插入图片描述

涟漪动画效果

  • type:effectScatter:能够产生涟漪动画的效果
  • rippleEffect :可以配置涟漪动画的大小
  • showEffectOn:以控制涟漪动画在什么时候产生, 它的可选值有两个: render 和 emphasis
    • render 代表界面渲染完成就开始涟漪动画
    • emphasis 代表鼠标移过某个散点的时候, 该散点开始涟漪动画
var option = {
  series: [
   {
      type: 'effectScatter',   // 产生涟漪动画的效果
      showEffectOn: 'emphasis',  // 鼠标移过某个散点的时候, 该散点开始涟漪动;可选其他值 rende
      rippleEffect:{
        scale:3    // 涟漪动画的大小
     }
   }
 ]
}

在这里插入图片描述

完整代码

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <!-- cdn方式 引入echarts.js文件 -->
    <script src="https://cdn.jsdelivr.net/npm/echarts@5.4.1/dist/echarts.min.js"></script>
</head>

<body>
<div style="width: 600px;height:400px"></div>
<script>
    //1. ECharts最基本的代码结构
    //2. x轴和y轴数据 二维数组 [ [身高,体重],...   ]
    //3. 将type的值设置为scatter, x轴和y轴的type都是value
    var data = [{"gender": "female", "height": 161.2, "weight": 51.6}, {
        "gender": "female",
        "height": 167.5,
        "weight": 59
    }, {"gender": "female", "height": 159.5, "weight": 49.2}, {
        "gender": "female",
        "height": 157,
        "weight": 63
    }, {"gender": "female", "height": 155.8, "weight": 53.6}, {
        "gender": "female",
        "height": 170,
        "weight": 59
    }, {"gender": "female", "height": 159.1, "weight": 47.6}, {
        "gender": "female",
        "height": 166,
        "weight": 69.8
    }, {"gender": "female", "height": 176.2, "weight": 66.8}, {
        "gender": "female",
        "height": 160.2,
        "weight": 75.2
    }, {"gender": "female", "height": 172.5, "weight": 55.2}, {
        "gender": "female",
        "height": 170.9,
        "weight": 54.2
    }, {"gender": "female", "height": 172.9, "weight": 62.5}, {
        "gender": "female",
        "height": 153.4,
        "weight": 42
    }, {"gender": "female", "height": 160, "weight": 50}, {
        "gender": "female",
        "height": 147.2,
        "weight": 49.8
    }, {"gender": "female", "height": 168.2, "weight": 49.2}, {
        "gender": "female",
        "height": 175,
        "weight": 73.2
    }, {"gender": "female", "height": 157, "weight": 47.8}, {
        "gender": "female",
        "height": 167.6,
        "weight": 68.8
    }, {"gender": "female", "height": 159.5, "weight": 50.6}, {
        "gender": "female",
        "height": 175,
        "weight": 82.5
    }, {"gender": "female", "height": 166.8, "weight": 57.2}, {
        "gender": "female",
        "height": 176.5,
        "weight": 87.8
    }, {"gender": "female", "height": 170.2, "weight": 72.8}, {
        "gender": "female",
        "height": 174,
        "weight": 54.5
    }, {"gender": "female", "height": 173, "weight": 59.8}, {
        "gender": "female",
        "height": 179.9,
        "weight": 67.3
    }, {"gender": "female", "height": 170.5, "weight": 67.8}, {
        "gender": "female",
        "height": 160,
        "weight": 47
    }, {"gender": "female", "height": 154.4, "weight": 46.2}, {
        "gender": "female",
        "height": 162,
        "weight": 55
    }, {"gender": "female", "height": 176.5, "weight": 83}, {
        "gender": "female",
        "height": 160,
        "weight": 54.4
    }, {"gender": "female", "height": 152, "weight": 45.8}, {
        "gender": "female",
        "height": 162.1,
        "weight": 53.6
    }, {"gender": "female", "height": 170, "weight": 73.2}, {
        "gender": "female",
        "height": 160.2,
        "weight": 52.1
    }, {"gender": "female", "height": 161.3, "weight": 67.9}, {
        "gender": "female",
        "height": 166.4,
        "weight": 56.6
    }, {"gender": "female", "height": 168.9, "weight": 62.3}, {
        "gender": "female",
        "height": 163.8,
        "weight": 58.5
    }, {"gender": "female", "height": 167.6, "weight": 54.5}, {
        "gender": "female",
        "height": 160,
        "weight": 50.2
    }, {"gender": "female", "height": 161.3, "weight": 60.3}, {
        "gender": "female",
        "height": 167.6,
        "weight": 58.3
    }, {"gender": "female", "height": 165.1, "weight": 56.2}, {
        "gender": "female",
        "height": 160,
        "weight": 50.2
    }, {"gender": "female", "height": 170, "weight": 72.9}, {
        "gender": "female",
        "height": 157.5,
        "weight": 59.8
    }, {"gender": "female", "height": 167.6, "weight": 61}, {
        "gender": "female",
        "height": 160.7,
        "weight": 69.1
    }, {"gender": "female", "height": 163.2, "weight": 55.9}, {
        "gender": "female",
        "height": 152.4,
        "weight": 46.5
    }, {"gender": "female", "height": 157.5, "weight": 54.3}, {
        "gender": "female",
        "height": 168.3,
        "weight": 54.8
    }, {"gender": "female", "height": 180.3, "weight": 60.7}, {
        "gender": "female",
        "height": 165.5,
        "weight": 60
    }, {"gender": "female", "height": 165, "weight": 62}, {
        "gender": "female",
        "height": 164.5,
        "weight": 60.3
    }, {"gender": "female", "height": 156, "weight": 52.7}, {
        "gender": "female",
        "height": 160,
        "weight": 74.3
    }, {"gender": "female", "height": 163, "weight": 62}, {
        "gender": "female",
        "height": 165.7,
        "weight": 73.1
    }, {"gender": "female", "height": 161, "weight": 80}, {
        "gender": "female",
        "height": 162,
        "weight": 54.7
    }, {"gender": "female", "height": 166, "weight": 53.2}, {
        "gender": "female",
        "height": 174,
        "weight": 75.7
    }, {"gender": "female", "height": 172.7, "weight": 61.1}, {
        "gender": "female",
        "height": 167.6,
        "weight": 55.7
    }, {"gender": "female", "height": 151.1, "weight": 48.7}, {
        "gender": "female",
        "height": 164.5,
        "weight": 52.3
    }, {"gender": "female", "height": 163.5, "weight": 50}, {
        "gender": "female",
        "height": 152,
        "weight": 59.3
    }, {"gender": "female", "height": 169, "weight": 62.5}, {
        "gender": "female",
        "height": 164,
        "weight": 55.7
    }, {"gender": "female", "height": 161.2, "weight": 54.8}, {
        "gender": "female",
        "height": 155,
        "weight": 45.9
    }, {"gender": "female", "height": 170, "weight": 70.6}, {
        "gender": "female",
        "height": 176.2,
        "weight": 67.2
    }, {"gender": "female", "height": 170, "weight": 69.4}, {
        "gender": "female",
        "height": 162.5,
        "weight": 58.2
    }, {"gender": "female", "height": 170.3, "weight": 64.8}, {
        "gender": "female",
        "height": 164.1,
        "weight": 71.6
    }, {"gender": "female", "height": 169.5, "weight": 52.8}, {
        "gender": "female",
        "height": 163.2,
        "weight": 59.8
    }, {"gender": "female", "height": 154.5, "weight": 49}, {
        "gender": "female",
        "height": 159.8,
        "weight": 50
    }, {"gender": "female", "height": 173.2, "weight": 69.2}, {
        "gender": "female",
        "height": 170,
        "weight": 55.9
    }, {"gender": "female", "height": 161.4, "weight": 63.4}, {
        "gender": "female",
        "height": 169,
        "weight": 58.2
    }, {"gender": "female", "height": 166.2, "weight": 58.6}, {
        "gender": "female",
        "height": 159.4,
        "weight": 45.7
    }, {"gender": "female", "height": 162.5, "weight": 52.2}, {
        "gender": "female",
        "height": 159,
        "weight": 48.6
    }, {"gender": "female", "height": 162.8, "weight": 57.8}, {
        "gender": "female",
        "height": 159,
        "weight": 55.6
    }, {"gender": "female", "height": 179.8, "weight": 66.8}, {
        "gender": "female",
        "height": 162.9,
        "weight": 59.4
    }, {"gender": "female", "height": 161, "weight": 53.6}, {
        "gender": "female",
        "height": 151.1,
        "weight": 73.2
    }, {"gender": "female", "height": 168.2, "weight": 53.4}, {
        "gender": "female",
        "height": 168.9,
        "weight": 69
    }, {"gender": "female", "height": 173.2, "weight": 58.4}, {
        "gender": "female",
        "height": 171.8,
        "weight": 56.2
    }, {"gender": "female", "height": 178, "weight": 70.6}, {
        "gender": "female",
        "height": 164.3,
        "weight": 59.8
    }, {"gender": "female", "height": 163, "weight": 72}, {
        "gender": "female",
        "height": 168.5,
        "weight": 65.2
    }, {"gender": "female", "height": 166.8, "weight": 56.6}, {
        "gender": "female",
        "height": 172.7,
        "weight": 105.2
    }, {"gender": "female", "height": 163.5, "weight": 51.8}, {
        "gender": "female",
        "height": 169.4,
        "weight": 63.4
    }, {"gender": "female", "height": 167.8, "weight": 59}, {
        "gender": "female",
        "height": 159.5,
        "weight": 47.6
    }, {"gender": "female", "height": 167.6, "weight": 63}, {
        "gender": "female",
        "height": 161.2,
        "weight": 55.2
    }, {"gender": "female", "height": 160, "weight": 45}, {
        "gender": "female",
        "height": 163.2,
        "weight": 54
    }, {"gender": "female", "height": 162.2, "weight": 50.2}, {
        "gender": "female",
        "height": 161.3,
        "weight": 60.2
    }, {"gender": "female", "height": 149.5, "weight": 44.8}, {
        "gender": "female",
        "height": 157.5,
        "weight": 58.8
    }, {"gender": "female", "height": 163.2, "weight": 56.4}, {
        "gender": "female",
        "height": 172.7,
        "weight": 62
    }, {"gender": "female", "height": 155, "weight": 49.2}, {
        "gender": "female",
        "height": 156.5,
        "weight": 67.2
    }, {"gender": "female", "height": 164, "weight": 53.8}, {
        "gender": "female",
        "height": 160.9,
        "weight": 54.4
    }, {"gender": "female", "height": 162.8, "weight": 58}, {
        "gender": "female",
        "height": 167,
        "weight": 59.8
    }, {"gender": "female", "height": 160, "weight": 54.8}, {
        "gender": "female",
        "height": 160,
        "weight": 43.2
    }, {"gender": "female", "height": 168.9, "weight": 60.5}, {
        "gender": "female",
        "height": 158.2,
        "weight": 46.4
    }, {"gender": "female", "height": 156, "weight": 64.4}, {
        "gender": "female",
        "height": 160,
        "weight": 48.8
    }, {"gender": "female", "height": 167.1, "weight": 62.2}, {
        "gender": "female",
        "height": 158,
        "weight": 55.5
    }, {"gender": "female", "height": 167.6, "weight": 57.8}, {
        "gender": "female",
        "height": 156,
        "weight": 54.6
    }, {"gender": "female", "height": 162.1, "weight": 59.2}, {
        "gender": "female",
        "height": 173.4,
        "weight": 52.7
    }, {"gender": "female", "height": 159.8, "weight": 53.2}, {
        "gender": "female",
        "height": 170.5,
        "weight": 64.5
    }, {"gender": "female", "height": 159.2, "weight": 51.8}, {
        "gender": "female",
        "height": 157.5,
        "weight": 56
    }, {"gender": "female", "height": 161.3, "weight": 63.6}, {
        "gender": "female",
        "height": 162.6,
        "weight": 63.2
    }, {"gender": "female", "height": 160, "weight": 59.5}, {
        "gender": "female",
        "height": 168.9,
        "weight": 56.8
    }, {"gender": "female", "height": 165.1, "weight": 64.1}, {
        "gender": "female",
        "height": 162.6,
        "weight": 50
    }, {"gender": "female", "height": 165.1, "weight": 72.3}, {
        "gender": "female",
        "height": 166.4,
        "weight": 55
    }, {"gender": "female", "height": 160, "weight": 55.9}, {
        "gender": "female",
        "height": 152.4,
        "weight": 60.4
    }, {"gender": "female", "height": 170.2, "weight": 69.1}, {
        "gender": "female",
        "height": 162.6,
        "weight": 84.5
    }, {"gender": "female", "height": 170.2, "weight": 55.9}, {
        "gender": "female",
        "height": 158.8,
        "weight": 55.5
    }, {"gender": "female", "height": 172.7, "weight": 69.5}, {
        "gender": "female",
        "height": 167.6,
        "weight": 76.4
    }, {"gender": "female", "height": 162.6, "weight": 61.4}, {
        "gender": "female",
        "height": 167.6,
        "weight": 65.9
    }, {"gender": "female", "height": 156.2, "weight": 58.6}, {
        "gender": "female",
        "height": 175.2,
        "weight": 66.8
    }, {"gender": "female", "height": 172.1, "weight": 56.6}, {
        "gender": "female",
        "height": 162.6,
        "weight": 58.6
    }, {"gender": "female", "height": 160, "weight": 55.9}, {
        "gender": "female",
        "height": 165.1,
        "weight": 59.1
    }, {"gender": "female", "height": 182.9, "weight": 81.8}, {
        "gender": "female",
        "height": 166.4,
        "weight": 70.7
    }, {"gender": "female", "height": 165.1, "weight": 56.8}, {
        "gender": "female",
        "height": 177.8,
        "weight": 60
    }, {"gender": "female", "height": 165.1, "weight": 58.2}, {
        "gender": "female",
        "height": 175.3,
        "weight": 72.7
    }, {"gender": "female", "height": 154.9, "weight": 54.1}, {
        "gender": "female",
        "height": 158.8,
        "weight": 49.1
    }, {"gender": "female", "height": 172.7, "weight": 75.9}, {
        "gender": "female",
        "height": 168.9,
        "weight": 55
    }, {"gender": "female", "height": 161.3, "weight": 57.3}, {
        "gender": "female",
        "height": 167.6,
        "weight": 55
    }, {"gender": "female", "height": 165.1, "weight": 65.5}, {
        "gender": "female",
        "height": 175.3,
        "weight": 65.5
    }, {"gender": "female", "height": 157.5, "weight": 48.6}, {
        "gender": "female",
        "height": 163.8,
        "weight": 58.6
    }, {"gender": "female", "height": 167.6, "weight": 63.6}, {
        "gender": "female",
        "height": 165.1,
        "weight": 55.2
    }, {"gender": "female", "height": 165.1, "weight": 62.7}, {
        "gender": "female",
        "height": 168.9,
        "weight": 56.6
    }, {"gender": "female", "height": 162.6, "weight": 53.9}, {
        "gender": "female",
        "height": 164.5,
        "weight": 63.2
    }, {"gender": "female", "height": 176.5, "weight": 73.6}, {
        "gender": "female",
        "height": 168.9,
        "weight": 62
    }, {"gender": "female", "height": 175.3, "weight": 63.6}, {
        "gender": "female",
        "height": 159.4,
        "weight": 53.2
    }, {"gender": "female", "height": 160, "weight": 53.4}, {
        "gender": "female",
        "height": 170.2,
        "weight": 55
    }, {"gender": "female", "height": 162.6, "weight": 70.5}, {
        "gender": "female",
        "height": 167.6,
        "weight": 54.5
    }, {"gender": "female", "height": 162.6, "weight": 54.5}, {
        "gender": "female",
        "height": 160.7,
        "weight": 55.9
    }, {"gender": "female", "height": 160, "weight": 59}, {
        "gender": "female",
        "height": 157.5,
        "weight": 63.6
    }, {"gender": "female", "height": 162.6, "weight": 54.5}, {
        "gender": "female",
        "height": 152.4,
        "weight": 47.3
    }, {"gender": "female", "height": 170.2, "weight": 67.7}, {
        "gender": "female",
        "height": 165.1,
        "weight": 80.9
    }, {"gender": "female", "height": 172.7, "weight": 70.5}, {
        "gender": "female",
        "height": 165.1,
        "weight": 60.9
    }, {"gender": "female", "height": 170.2, "weight": 63.6}, {
        "gender": "female",
        "height": 170.2,
        "weight": 54.5
    }, {"gender": "female", "height": 170.2, "weight": 59.1}, {
        "gender": "female",
        "height": 161.3,
        "weight": 70.5
    }, {"gender": "female", "height": 167.6, "weight": 52.7}, {
        "gender": "female",
        "height": 167.6,
        "weight": 62.7
    }, {"gender": "female", "height": 165.1, "weight": 86.3}, {
        "gender": "female",
        "height": 162.6,
        "weight": 66.4
    }, {"gender": "female", "height": 152.4, "weight": 67.3}, {
        "gender": "female",
        "height": 168.9,
        "weight": 63
    }, {"gender": "female", "height": 170.2, "weight": 73.6}, {
        "gender": "female",
        "height": 175.2,
        "weight": 62.3
    }, {"gender": "female", "height": 175.2, "weight": 57.7}, {
        "gender": "female",
        "height": 160,
        "weight": 55.4
    }, {"gender": "female", "height": 165.1, "weight": 104.1}, {
        "gender": "female",
        "height": 174,
        "weight": 55.5
    }, {"gender": "female", "height": 170.2, "weight": 77.3}, {
        "gender": "female",
        "height": 160,
        "weight": 80.5
    }, {"gender": "female", "height": 167.6, "weight": 64.5}, {
        "gender": "female",
        "height": 167.6,
        "weight": 72.3
    }, {"gender": "female", "height": 167.6, "weight": 61.4}, {
        "gender": "female",
        "height": 154.9,
        "weight": 58.2
    }, {"gender": "female", "height": 162.6, "weight": 81.8}, {
        "gender": "female",
        "height": 175.3,
        "weight": 63.6
    }, {"gender": "female", "height": 171.4, "weight": 53.4}, {
        "gender": "female",
        "height": 157.5,
        "weight": 54.5
    }, {"gender": "female", "height": 165.1, "weight": 53.6}, {
        "gender": "female",
        "height": 160,
        "weight": 60
    }, {"gender": "female", "height": 174, "weight": 73.6}, {
        "gender": "female",
        "height": 162.6,
        "weight": 61.4
    }, {"gender": "female", "height": 174, "weight": 55.5}, {
        "gender": "female",
        "height": 162.6,
        "weight": 63.6
    }, {"gender": "female", "height": 161.3, "weight": 60.9}, {
        "gender": "female",
        "height": 156.2,
        "weight": 60
    }, {"gender": "female", "height": 149.9, "weight": 46.8}, {
        "gender": "female",
        "height": 169.5,
        "weight": 57.3
    }, {"gender": "female", "height": 160, "weight": 64.1}, {
        "gender": "female",
        "height": 175.3,
        "weight": 63.6
    }, {"gender": "female", "height": 169.5, "weight": 67.3}, {
        "gender": "female",
        "height": 160,
        "weight": 75.5
    }, {"gender": "female", "height": 172.7, "weight": 68.2}, {
        "gender": "female",
        "height": 162.6,
        "weight": 61.4
    }, {"gender": "female", "height": 157.5, "weight": 76.8}, {
        "gender": "female",
        "height": 176.5,
        "weight": 71.8
    }, {"gender": "female", "height": 164.4, "weight": 55.5}, {
        "gender": "female",
        "height": 160.7,
        "weight": 48.6
    }, {"gender": "female", "height": 174, "weight": 66.4}, {
        "gender": "female",
        "height": 163.8,
        "weight": 67.3
    }, {"gender": "male", "height": 174, "weight": 65.6}, {
        "gender": "male",
        "height": 175.3,
        "weight": 71.8
    }, {"gender": "male", "height": 193.5, "weight": 80.7}, {
        "gender": "male",
        "height": 186.5,
        "weight": 72.6
    }, {"gender": "male", "height": 187.2, "weight": 78.8}, {
        "gender": "male",
        "height": 181.5,
        "weight": 74.8
    }, {"gender": "male", "height": 184, "weight": 86.4}, {
        "gender": "male",
        "height": 184.5,
        "weight": 78.4
    }, {"gender": "male", "height": 175, "weight": 62}, {
        "gender": "male",
        "height": 184,
        "weight": 81.6
    }, {"gender": "male", "height": 180, "weight": 76.6}, {
        "gender": "male",
        "height": 177.8,
        "weight": 83.6
    }, {"gender": "male", "height": 192, "weight": 90}, {
        "gender": "male",
        "height": 176,
        "weight": 74.6
    }, {"gender": "male", "height": 174, "weight": 71}, {
        "gender": "male",
        "height": 184,
        "weight": 79.6
    }, {"gender": "male", "height": 192.7, "weight": 93.8}, {
        "gender": "male",
        "height": 171.5,
        "weight": 70
    }, {"gender": "male", "height": 173, "weight": 72.4}, {
        "gender": "male",
        "height": 176,
        "weight": 85.9
    }, {"gender": "male", "height": 176, "weight": 78.8}, {
        "gender": "male",
        "height": 180.5,
        "weight": 77.8
    }, {"gender": "male", "height": 172.7, "weight": 66.2}, {
        "gender": "male",
        "height": 176,
        "weight": 86.4
    }, {"gender": "male", "height": 173.5, "weight": 81.8}, {
        "gender": "male",
        "height": 178,
        "weight": 89.6
    }, {"gender": "male", "height": 180.3, "weight": 82.8}, {
        "gender": "male",
        "height": 180.3,
        "weight": 76.4
    }, {"gender": "male", "height": 164.5, "weight": 63.2}, {
        "gender": "male",
        "height": 173,
        "weight": 60.9
    }, {"gender": "male", "height": 183.5, "weight": 74.8}, {
        "gender": "male",
        "height": 175.5,
        "weight": 70
    }, {"gender": "male", "height": 188, "weight": 72.4}, {
        "gender": "male",
        "height": 189.2,
        "weight": 84.1
    }, {"gender": "male", "height": 172.8, "weight": 69.1}, {
        "gender": "male",
        "height": 170,
        "weight": 59.5
    }, {"gender": "male", "height": 182, "weight": 67.2}, {
        "gender": "male",
        "height": 170,
        "weight": 61.3
    }, {"gender": "male", "height": 177.8, "weight": 68.6}, {
        "gender": "male",
        "height": 184.2,
        "weight": 80.1
    }, {"gender": "male", "height": 186.7, "weight": 87.8}, {
        "gender": "male",
        "height": 171.4,
        "weight": 84.7
    }, {"gender": "male", "height": 172.7, "weight": 73.4}, {
        "gender": "male",
        "height": 175.3,
        "weight": 72.1
    }, {"gender": "male", "height": 180.3, "weight": 82.6}, {
        "gender": "male",
        "height": 182.9,
        "weight": 88.7
    }, {"gender": "male", "height": 188, "weight": 84.1}, {
        "gender": "male",
        "height": 177.2,
        "weight": 94.1
    }, {"gender": "male", "height": 172.1, "weight": 74.9}, {
        "gender": "male",
        "height": 167,
        "weight": 59.1
    }, {"gender": "male", "height": 169.5, "weight": 75.6}, {
        "gender": "male",
        "height": 174,
        "weight": 86.2
    }, {"gender": "male", "height": 172.7, "weight": 75.3}, {
        "gender": "male",
        "height": 182.2,
        "weight": 87.1
    }, {"gender": "male", "height": 164.1, "weight": 55.2}, {
        "gender": "male",
        "height": 163,
        "weight": 57
    }, {"gender": "male", "height": 171.5, "weight": 61.4}, {
        "gender": "male",
        "height": 184.2,
        "weight": 76.8
    }, {"gender": "male", "height": 174, "weight": 86.8}, {
        "gender": "male",
        "height": 174,
        "weight": 72.2
    }, {"gender": "male", "height": 177, "weight": 71.6}, {
        "gender": "male",
        "height": 186,
        "weight": 84.8
    }, {"gender": "male", "height": 167, "weight": 68.2}, {
        "gender": "male",
        "height": 171.8,
        "weight": 66.1
    }, {"gender": "male", "height": 182, "weight": 72}, {
        "gender": "male",
        "height": 167,
        "weight": 64.6
    }, {"gender": "male", "height": 177.8, "weight": 74.8}, {
        "gender": "male",
        "height": 164.5,
        "weight": 70
    }, {"gender": "male", "height": 192, "weight": 101.6}, {
        "gender": "male",
        "height": 175.5,
        "weight": 63.2
    }, {"gender": "male", "height": 171.2, "weight": 79.1}, {
        "gender": "male",
        "height": 181.6,
        "weight": 78.9
    }, {"gender": "male", "height": 167.4, "weight": 67.7}, {
        "gender": "male",
        "height": 181.1,
        "weight": 66
    }, {"gender": "male", "height": 177, "weight": 68.2}, {
        "gender": "male",
        "height": 174.5,
        "weight": 63.9
    }, {"gender": "male", "height": 177.5, "weight": 72}, {
        "gender": "male",
        "height": 170.5,
        "weight": 56.8
    }, {"gender": "male", "height": 182.4, "weight": 74.5}, {
        "gender": "male",
        "height": 197.1,
        "weight": 90.9
    }, {"gender": "male", "height": 180.1, "weight": 93}, {
        "gender": "male",
        "height": 175.5,
        "weight": 80.9
    }, {"gender": "male", "height": 180.6, "weight": 72.7}, {
        "gender": "male",
        "height": 184.4,
        "weight": 68
    }, {"gender": "male", "height": 175.5, "weight": 70.9}, {
        "gender": "male",
        "height": 180.6,
        "weight": 72.5
    }, {"gender": "male", "height": 177, "weight": 72.5}, {
        "gender": "male",
        "height": 177.1,
        "weight": 83.4
    }, {"gender": "male", "height": 181.6, "weight": 75.5}, {
        "gender": "male",
        "height": 176.5,
        "weight": 73
    }, {"gender": "male", "height": 175, "weight": 70.2}, {
        "gender": "male",
        "height": 174,
        "weight": 73.4
    }, {"gender": "male", "height": 165.1, "weight": 70.5}, {
        "gender": "male",
        "height": 177,
        "weight": 68.9
    }, {"gender": "male", "height": 192, "weight": 102.3}, {
        "gender": "male",
        "height": 176.5,
        "weight": 68.4
    }, {"gender": "male", "height": 169.4, "weight": 65.9}, {
        "gender": "male",
        "height": 182.1,
        "weight": 75.7
    }, {"gender": "male", "height": 179.8, "weight": 84.5}, {
        "gender": "male",
        "height": 175.3,
        "weight": 87.7
    }, {"gender": "male", "height": 184.9, "weight": 86.4}, {
        "gender": "male",
        "height": 177.3,
        "weight": 73.2
    }, {"gender": "male", "height": 167.4, "weight": 53.9}, {
        "gender": "male",
        "height": 178.1,
        "weight": 72
    }, {"gender": "male", "height": 168.9, "weight": 55.5}, {
        "gender": "male",
        "height": 157.2,
        "weight": 58.4
    }, {"gender": "male", "height": 180.3, "weight": 83.2}, {
        "gender": "male",
        "height": 170.2,
        "weight": 72.7
    }, {"gender": "male", "height": 177.8, "weight": 64.1}, {
        "gender": "male",
        "height": 172.7,
        "weight": 72.3
    }, {"gender": "male", "height": 165.1, "weight": 65}, {
        "gender": "male",
        "height": 186.7,
        "weight": 86.4
    }, {"gender": "male", "height": 165.1, "weight": 65}, {
        "gender": "male",
        "height": 174,
        "weight": 88.6
    }, {"gender": "male", "height": 175.3, "weight": 84.1}, {
        "gender": "male",
        "height": 185.4,
        "weight": 66.8
    }, {"gender": "male", "height": 177.8, "weight": 75.5}, {
        "gender": "male",
        "height": 180.3,
        "weight": 93.2
    }, {"gender": "male", "height": 180.3, "weight": 82.7}, {
        "gender": "male",
        "height": 177.8,
        "weight": 58
    }, {"gender": "male", "height": 177.8, "weight": 79.5}, {
        "gender": "male",
        "height": 177.8,
        "weight": 78.6
    }, {"gender": "male", "height": 177.8, "weight": 71.8}, {
        "gender": "male",
        "height": 177.8,
        "weight": 116.4
    }, {"gender": "male", "height": 163.8, "weight": 72.2}, {
        "gender": "male",
        "height": 188,
        "weight": 83.6
    }, {"gender": "male", "height": 198.1, "weight": 85.5}, {
        "gender": "male",
        "height": 175.3,
        "weight": 90.9
    }, {"gender": "male", "height": 166.4, "weight": 85.9}, {
        "gender": "male",
        "height": 190.5,
        "weight": 89.1
    }, {"gender": "male", "height": 166.4, "weight": 75}, {
        "gender": "male",
        "height": 177.8,
        "weight": 77.7
    }, {"gender": "male", "height": 179.7, "weight": 86.4}, {
        "gender": "male",
        "height": 172.7,
        "weight": 90.9
    }, {"gender": "male", "height": 190.5, "weight": 73.6}, {
        "gender": "male",
        "height": 185.4,
        "weight": 76.4
    }, {"gender": "male", "height": 168.9, "weight": 69.1}, {
        "gender": "male",
        "height": 167.6,
        "weight": 84.5
    }, {"gender": "male", "height": 175.3, "weight": 64.5}, {
        "gender": "male",
        "height": 170.2,
        "weight": 69.1
    }, {"gender": "male", "height": 190.5, "weight": 108.6}, {
        "gender": "male",
        "height": 177.8,
        "weight": 86.4
    }, {"gender": "male", "height": 190.5, "weight": 80.9}, {
        "gender": "male",
        "height": 177.8,
        "weight": 87.7
    }, {"gender": "male", "height": 184.2, "weight": 94.5}, {
        "gender": "male",
        "height": 176.5,
        "weight": 80.2
    }, {"gender": "male", "height": 177.8, "weight": 72}, {
        "gender": "male",
        "height": 180.3,
        "weight": 71.4
    }, {"gender": "male", "height": 171.4, "weight": 72.7}, {
        "gender": "male",
        "height": 172.7,
        "weight": 84.1
    }, {"gender": "male", "height": 172.7, "weight": 76.8}, {
        "gender": "male",
        "height": 177.8,
        "weight": 63.6
    }, {"gender": "male", "height": 177.8, "weight": 80.9}, {
        "gender": "male",
        "height": 182.9,
        "weight": 80.9
    }, {"gender": "male", "height": 170.2, "weight": 85.5}, {
        "gender": "male",
        "height": 167.6,
        "weight": 68.6
    }, {"gender": "male", "height": 175.3, "weight": 67.7}, {
        "gender": "male",
        "height": 165.1,
        "weight": 66.4
    }, {"gender": "male", "height": 185.4, "weight": 102.3}, {
        "gender": "male",
        "height": 181.6,
        "weight": 70.5
    }, {"gender": "male", "height": 172.7, "weight": 95.9}, {
        "gender": "male",
        "height": 190.5,
        "weight": 84.1
    }, {"gender": "male", "height": 179.1, "weight": 87.3}, {
        "gender": "male",
        "height": 175.3,
        "weight": 71.8
    }, {"gender": "male", "height": 170.2, "weight": 65.9}, {
        "gender": "male",
        "height": 193,
        "weight": 95.9
    }, {"gender": "male", "height": 171.4, "weight": 91.4}, {
        "gender": "male",
        "height": 177.8,
        "weight": 81.8
    }, {"gender": "male", "height": 177.8, "weight": 96.8}, {
        "gender": "male",
        "height": 167.6,
        "weight": 69.1
    }, {"gender": "male", "height": 167.6, "weight": 82.7}, {
        "gender": "male",
        "height": 180.3,
        "weight": 75.5
    }, {"gender": "male", "height": 182.9, "weight": 79.5}, {
        "gender": "male",
        "height": 176.5,
        "weight": 73.6
    }, {"gender": "male", "height": 186.7, "weight": 91.8}, {
        "gender": "male",
        "height": 188,
        "weight": 84.1
    }, {"gender": "male", "height": 188, "weight": 85.9}, {
        "gender": "male",
        "height": 177.8,
        "weight": 81.8
    }, {"gender": "male", "height": 174, "weight": 82.5}, {
        "gender": "male",
        "height": 177.8,
        "weight": 80.5
    }, {"gender": "male", "height": 171.4, "weight": 70}, {
        "gender": "male",
        "height": 185.4,
        "weight": 81.8
    }, {"gender": "male", "height": 185.4, "weight": 84.1}, {
        "gender": "male",
        "height": 188,
        "weight": 90.5
    }, {"gender": "male", "height": 188, "weight": 91.4}, {
        "gender": "male",
        "height": 182.9,
        "weight": 89.1
    }, {"gender": "male", "height": 176.5, "weight": 85}, {
        "gender": "male",
        "height": 175.3,
        "weight": 69.1
    }, {"gender": "male", "height": 175.3, "weight": 73.6}, {
        "gender": "male",
        "height": 188,
        "weight": 80.5
    }, {"gender": "male", "height": 188, "weight": 82.7}, {
        "gender": "male",
        "height": 175.3,
        "weight": 86.4
    }, {"gender": "male", "height": 170.5, "weight": 67.7}, {
        "gender": "male",
        "height": 179.1,
        "weight": 92.7
    }, {"gender": "male", "height": 177.8, "weight": 93.6}, {
        "gender": "male",
        "height": 175.3,
        "weight": 70.9
    }, {"gender": "male", "height": 182.9, "weight": 75}, {
        "gender": "male",
        "height": 170.8,
        "weight": 93.2
    }, {"gender": "male", "height": 188, "weight": 93.2}, {
        "gender": "male",
        "height": 180.3,
        "weight": 77.7
    }, {"gender": "male", "height": 177.8, "weight": 61.4}, {
        "gender": "male",
        "height": 185.4,
        "weight": 94.1
    }, {"gender": "male", "height": 168.9, "weight": 75}, {
        "gender": "male",
        "height": 185.4,
        "weight": 83.6
    }, {"gender": "male", "height": 180.3, "weight": 85.5}, {
        "gender": "male",
        "height": 174,
        "weight": 73.9
    }, {"gender": "male", "height": 167.6, "weight": 66.8}, {
        "gender": "male",
        "height": 182.9,
        "weight": 87.3
    }, {"gender": "male", "height": 160, "weight": 72.3}, {
        "gender": "male",
        "height": 180.3,
        "weight": 88.6
    }, {"gender": "male", "height": 167.6, "weight": 75.5}, {
        "gender": "male",
        "height": 186.7,
        "weight": 101.4
    }, {"gender": "male", "height": 175.3, "weight": 91.1}, {
        "gender": "male",
        "height": 175.3,
        "weight": 67.3
    }, {"gender": "male", "height": 175.9, "weight": 77.7}, {
        "gender": "male",
        "height": 175.3,
        "weight": 81.8
    }, {"gender": "male", "height": 179.1, "weight": 75.5}, {
        "gender": "male",
        "height": 181.6,
        "weight": 84.5
    }, {"gender": "male", "height": 177.8, "weight": 76.6}, {
        "gender": "male",
        "height": 182.9,
        "weight": 85
    }, {"gender": "male", "height": 177.8, "weight": 102.5}, {
        "gender": "male",
        "height": 184.2,
        "weight": 77.3
    }, {"gender": "male", "height": 179.1, "weight": 71.8}, {
        "gender": "male",
        "height": 176.5,
        "weight": 87.9
    }, {"gender": "male", "height": 188, "weight": 94.3}, {
        "gender": "male",
        "height": 174,
        "weight": 70.9
    }, {"gender": "male", "height": 167.6, "weight": 64.5}, {
        "gender": "male",
        "height": 170.2,
        "weight": 77.3
    }, {"gender": "male", "height": 167.6, "weight": 72.3}, {
        "gender": "male",
        "height": 188,
        "weight": 87.3
    }, {"gender": "male", "height": 174, "weight": 80}, {
        "gender": "male",
        "height": 176.5,
        "weight": 82.3
    }, {"gender": "male", "height": 180.3, "weight": 73.6}, {
        "gender": "male",
        "height": 167.6,
        "weight": 74.1
    }, {"gender": "male", "height": 188, "weight": 85.9}, {
        "gender": "male",
        "height": 180.3,
        "weight": 73.2
    }, {"gender": "male", "height": 167.6, "weight": 76.3}, {
        "gender": "male",
        "height": 183,
        "weight": 65.9
    }, {"gender": "male", "height": 183, "weight": 90.9}, {
        "gender": "male",
        "height": 179.1,
        "weight": 89.1
    }, {"gender": "male", "height": 170.2, "weight": 62.3}, {
        "gender": "male",
        "height": 177.8,
        "weight": 82.7
    }, {"gender": "male", "height": 179.1, "weight": 79.1}, {
        "gender": "male",
        "height": 190.5,
        "weight": 98.2
    }, {"gender": "male", "height": 177.8, "weight": 84.1}, {
        "gender": "male",
        "height": 180.3,
        "weight": 83.2
    }, {"gender": "male", "height": 180.3, "weight": 83.2}]
    var axisData = []
    for (var i = 0; i < data.length; i++) {
        var height = data[i].height
        var weight = data[i].weight
        var newArr = [height, weight]
        axisData.push(newArr)
    }
    console.log(axisData)
    var mCharts = echarts.init(document.querySelector("div"))
    var option = {
        // 4. 调整配置项, 脱离0值比例
        xAxis: {
            type: 'value',
            scale: true
        },
        yAxis: {
            type: 'value',
            scale: true
        },
        series: [
            {
                // type: 'scatter', // 指明图表的类型为散点图
                type: 'effectScatter',  // 涟漪动画的效果
                data: axisData,
                // symbolSize: 15,  // 控制散点大小
                // itemStyle: {   // 散点颜色
                //     color: 'green'
                // }
                showEffectOn: 'emphasis',  // 鼠标移过某个散点的时候, 该散点开始涟漪动;可选其他值 render
                rippleEffect: {
                    scale: 3
                },
                symbolSize: function (arg) {
                    var weight = arg[1]
                    var height = arg[0] / 100
                    // BMI > 28 则代表肥胖, 肥胖的人用大的散点标识, 正常的人用小散点标识
                    // BMI: 体重/ 身高*身高 kg*m
                    var bmi = weight / (height * height)
                    if (bmi > 28) {
                        return 20
                    }
                    return 5
                },
                itemStyle: {
                    color: function (arg) {
                        var weight = arg.data[1]
                        var height = arg.data[0] / 100
                        var bmi = weight / (height * height)
                        if (bmi > 28) {
                            return 'red'
                        }
                        return 'green'
                    }
                }
            }
        ]
    }
    mCharts.setOption(option)
</script>
</body>
</html>

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

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

相关文章

解决 AssertionError Torch not compiled with CUDA enabled

最近在矩池云的的Tesla K80机子上跑MMYOLO&#xff0c;跟着MMYOLO官方文档《自定义数据集 标注训练测试部署 全流程 》操作到 “2.1.1 软件或者算法辅助”时&#xff0c;利用预训练模型官方脚本去辅助标注时&#xff0c;一按下回车就报错&#xff1a; 报错信息 AssertionError…

技巧分享:你知道视频转文字怎么操作?

随着科技的发展&#xff0c;很多东西都开通了“线上”这个渠道&#xff0c;例如线上教学、线上问诊等等。而我们也越来越习惯“线上”&#xff0c;因为它不仅方便&#xff0c;还更节省时间。例如我&#xff0c;学习一些知识或技能时&#xff0c;我会在网上寻找教学视频或报线上…

flink单机部署和简单使用

flink单机部署 Java版本&#xff1a;1.8.0_45 flink下载&#xff1a;https://archive.apache.org/dist/flink/flink-1.7.2/flink-1.7.2-bin-scala_2.11.tgz 解压安装包&#xff1a; [rootvm-9f-mysteel-dc-ebc-test03 opt]# tar -zxvf flink-1.7.2-bin-scala_2.11.tgz flin…

莽荒纪人物出场数据统计

今天继续给大家介绍Python相关知识&#xff0c;本文主要内容莽荒纪人物出场数据统计。 一、中文文本词频统计思路 在上文Python英文词频统计&#xff08;哈姆雷特&#xff09;程序示例中&#xff0c;我们进行了英文单词的统计。今天&#xff0c;我们进行中文人物出场频率统计…

java服装经销系统服装进销系统

简介 Ssm服装经销系统&#xff0c;主要分为6个角色&#xff1a;管理员、资料员、采购员、仓库员、售卖员、财务。采购员进行采购入库&#xff1b;仓库员进行采购入库、退货入库、提货出库、折损出库等库存管理&#xff1b;售卖员进行填单的创建&#xff0c;然后去仓库那里提货…

Score Matching

目录简介Score Function求解方法emm参考简介 score matching算法是一种求解概率密度函数的参数的算法。 在很多情况下&#xff0c;概率密度函数可以表示为&#xff1a; p(ξ;θ)1Z(θ)q(ξ;θ)p(\xi;\theta)\frac{1}{Z(\theta)}q(\xi;\theta) p(ξ;θ)Z(θ)1​q(ξ;θ) 假设我…

[Java] 什么是锁?什么是并发控制?线程安全又是什么?锁的本质是什么?如何实现一个锁?

文章目录前言并发控制并发访问控制是什么&#xff1f;如何实现并发访问控制&#xff1f;并发访问控制 与 线程安全锁是什么&#xff1f;1. 加锁操作2. 解锁操作锁状态是什么&#xff1f;如何实现一个锁&#xff1f;笔者相关博客连接结语前言 多线程编程中&#xff0c;锁是最重要…

oracle (+)学习

最近工作需要将oracle的存储过程转化为hive的sql脚本。遇到很多不一样的地方&#xff0c;例如oracle连接中有()号的用法。 借鉴这篇文章&#xff0c;但是这个排版比较烂。。。 oracle ()的,Oracle中()的作用_大雪菜的博客-CSDN博客 先建表和插入数据 --生成部门表CREATE TA…

2014年蓝桥杯Java C组——猜年龄

2014年蓝桥杯Java C组——猜年龄 标题&#xff1a;猜年龄 小明带两个妹妹参加元宵灯会。别人问她们多大了&#xff0c;她们调皮地说:“ 我们俩的年龄之积是年龄之和的6倍”。 小明又补充说:“她们可不是双胞胎&#xff0c;年龄差肯定也不超过8岁啊。” 请你写出:小明的较小的…

状态模式

文章目录状态模式1.状态模式的本质2.何时选用状态模式3.优缺点4.状态模式的结构5.实现上下文中维护状态及转换状态上下文中维护状态处理类中转换状态状态模式 状态模式说白了就是不同的状态&#xff0c;执行不同的行为&#xff0c;也就是状态和行为分离 1.状态模式的本质 状态模…

Eclipse+Java+Swing+Mysql实现自助存取款机(ATM)系统

EclipseJavaSwingMysql实现自助存取款机ATM系统一、系统介绍1.系统功能2.环境配置3.数据库4.工程截图二、系统展示1.登录页1.1登录成功2.注册系统3.取款3.1取款成功4.存款4.1 存款成功5.转账6.余额查询7.退出系统三、部分代码DBUtil.javaLoginFrame.javaAccount.java四、其他获…

python编程 for循环注意点与大写转换案例

作者简介&#xff1a;一名在校计算机学生、每天分享Python的学习经验、和学习笔记。 座右铭&#xff1a;低头赶路&#xff0c;敬事如仪 个人主页&#xff1a;网络豆的主页​​​​​​ 目录 前言 range方法 一for循环表达式 for循环表达式 与数字有关 与单位有关 前言…

2023最新SSM计算机毕业设计选题大全(附源码+LW)之java基于信息安全的无锡旅游服务系统5l83d

面对老师五花八门的设计要求&#xff0c;首先自己要明确好自己的题目方向&#xff0c;并且与老师多多沟通&#xff0c;用什么编程语言&#xff0c;使用到什么数据库&#xff0c;确定好了&#xff0c;在开始着手毕业设计。 1&#xff1a;选择课题的第一选择就是尽量选择指导老师…

MHA的故障切换你掌握了吗?

MHA的概述 什么是MHA MHA&#xff08;MasterHigh Availability&#xff09;是一套优秀的MySQL高可用环境下故障切换和主从复制的软件。 MHA 的出现就是解决MySQL 单点的问题。 MySQL故障切换过程中&#xff0c;MHA能做到0-30秒内自动完成故障切换操作。 MHA能在故障切换的过程…

用Python构建Amazon产品推荐系统!这项目价值能有2000吗?

引言 该项目的目标是部分重建Amazon电子类产品的推荐系统。 现在是十二月&#xff01;你是什么类型的购物者&#xff1f;双十二都购买了吗&#xff1f;你是把当天想购买的所有产品都保存起来&#xff0c;还是宁愿打开网站&#xff0c;查看带有巨大折扣的现场优惠呢&#xff1…

从单服务器模式到负载均衡设计

从单服务器模式到负载均衡设计 作者&#xff1a;Grey 原文地址&#xff1a; 博客园&#xff1a;从单服务器模式到负载均衡设计 CSDN&#xff1a;从单服务器模式到负载均衡设计 单服务器模型是最简单的一种架构&#xff0c;参考如下图 用户访问一个 URL&#xff0c;URL 会…

java计算机毕业设计基于安卓Android的校园外卖点餐APP

项目介绍 餐饮行业是一个传统的行业。根据当前发展现状,网络信息时代的全面普及,餐饮行业也在发生着变化,单就点餐这一方面,利用手机点单正在逐步进入人们的生活。传统的点餐方式,不仅会耗费大量的人力、时间,有时候还会出错。Android系统伴随智能手机为我们提供了新的方向。手…

基于转换器 (MMC) 技术和电压源转换器 (VSC) 的高压直流 (HVDC) 模型(MatlabSimulink实现)

目录 1 概述 2 主要模块说明 2.1 简化电网 2.2 转换器 1 2.3 直流电路 2.4 控制器 2.5 示波器和测量 3 讲解 3.1 参数设置 3.2 SPS 比较 3.3 结果比较 3.4 参考文献 4 Matlab代码实现 1 概述 1000 MW HVDC-MMC 互连的 SPS 模型。本文基于模块化多电平转换器 (MMC)…

计算机网络-数据链路层:以太网协议、ARP协议、MAC、MTU

目录 一、以太网协议 1. 认识以太网 2. 协议格式 二、 MAC地址 1. 认识MAC地址 2. 对比MAC地址与IP地址 三、ARP协议 1. 认识ARP协议 2. ARP协议的作用 3. ARP协议的工作流程 4. ARP欺骗攻击 四、MTU 1. 认识MTU 2. MTU对IP协议的影响&#xff08;了解&#xff…

在线教育系统源码讲解与代码分析

目前&#xff0c;许多行业已经开始向直播领域靠拢&#xff0c;例如直播带货、教育直播、娱乐直播等领域&#xff0c;想要在此分一杯羹&#xff0c;以在线教育系统来说&#xff0c;在2020年以后便进入了“白热化”&#xff0c;更多的直播、教育展现在大众视野中。在粉丝经济的时…