当前位置:   article > 正文

springboot+echarts +mysql制作数据可视化大屏(六图)_用sqoop导入mysql,再用echars实现可视化大屏

用sqoop导入mysql,再用echars实现可视化大屏

 作者水平低,如有错误,恳请指正!谢谢!!!!!

项目简单,适合大学生参考

分类专栏还有其它的可视化博客哦!

专栏地址:https://blog.csdn.net/qq_55906442/category_11906804.html?spm=1001.2014.3001.5482

目录

 一、数据源

二、所需工具

三、项目框架搭建

四、代码编写

订单金额折线图

利润情况信息

虚拟柱状图

平均支付时间统计

订单金额统计

旭日图

五、大屏编写


成果展示:

 一、数据源

1)可以使用自己的MySQL数据库;

2)使用我提供的数据。(要数据私信/留言——>留下邮箱即可)

二、所需工具

MySQL、IDEA、jdk1.8、Maven等等,总之编写工具要准备好,环境要搭建好

三、项目框架搭建

参考我博客的项目框架搭建,从3.1看到4.3即可springboot+mybatis+echarts +mysql制作数据可视化大屏_spring + 可视化大屏_一个人的牛牛的博客-CSDN博客

四、代码编写

代码简单,后端代码都写在一起了,没有区分controller等等,前端也是一样,没有单独写js等等。有些图数据为了偷懒是手敲的,没有从数据库读取。

订单金额折线图

后端

  1. import org.springframework.beans.factory.annotation.Autowired;
  2. import org.springframework.jdbc.core.JdbcTemplate;
  3. import org.springframework.web.bind.annotation.GetMapping;
  4. import org.springframework.web.bind.annotation.RestController;
  5. import java.util.ArrayList;
  6. import java.util.HashMap;
  7. import java.util.List;
  8. import java.util.Map;
  9. @RestController
  10. public class Big2Controller {
  11. private final JdbcTemplate jdbcTemplate;
  12. @Autowired
  13. public Big2Controller(JdbcTemplate jdbcTemplate) {
  14. this.jdbcTemplate = jdbcTemplate;
  15. }
  16. @GetMapping("/chart-data2")
  17. public Map<String, Object> getChartData() {
  18. String query = "SELECT dt, order_amount FROM ads_order_daycount";
  19. List<Map<String, Object>> result = jdbcTemplate.queryForList(query);
  20. List<String> labels = new ArrayList<>();
  21. List<Integer> values = new ArrayList<>();
  22. for (Map<String, Object> row : result) {
  23. String dt = row.get("dt").toString();
  24. Integer orderAmount = ((Number) row.get("order_amount")).intValue();
  25. labels.add(dt);
  26. values.add(orderAmount);
  27. }
  28. Map<String, Object> data = new HashMap<>();
  29. data.put("labels", labels);
  30. data.put("values", values);
  31. return data;
  32. }
  33. }

 验证接口:运行项目,浏览器访问http://localhost:8081/chart-data2

前端

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>折线图</title>
  6. <style>
  7. html, body {
  8. height: 100%;
  9. margin: 0;
  10. padding: 0;
  11. }
  12. #chart-container {
  13. width: 100%;
  14. height: 100%;
  15. min-height: 300px; /* 设置最小高度,防止内容过小时显示异常 */
  16. }
  17. </style>
  18. </head>
  19. <body>
  20. <div id="chart-container"></div>
  21. <script src="https://cdn.jsdelivr.net/npm/echarts@5.2.2/dist/echarts.min.js"></script>
  22. <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
  23. <script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
  24. <script>
  25. // 使用 Axios 发送 AJAX 请求
  26. axios.get('/chart-data2')
  27. .then(function (response) {
  28. // 处理从后端返回的数据
  29. const data = response.data;
  30. // 提取 X 轴和 Y 轴数据
  31. const xData = data.labels;
  32. const yData = data.values;
  33. // 创建图表
  34. const chartContainer = document.getElementById('chart-container');
  35. const chart = echarts.init(chartContainer);
  36. // 监听窗口大小变化事件
  37. window.addEventListener('resize', function() {
  38. chart.resize(); // 调整图表大小
  39. });
  40. const option = {
  41. title: {
  42. text: '订单金额折线图'
  43. },
  44. xAxis: {
  45. type: 'category',
  46. data: xData
  47. },
  48. yAxis: {
  49. type: 'value'
  50. },
  51. series: [{
  52. type: 'line',
  53. data: yData,
  54. areaStyle: {
  55. color: 'rgba(0, 128, 255, 0.3)' // 设置背景颜色
  56. }
  57. }]
  58. };
  59. // 渲染图表
  60. chart.setOption(option);
  61. })
  62. .catch(function (error) {
  63. console.log(error);
  64. });
  65. </script>
  66. </body>
  67. </html>

验证页面:运行项目,浏览器访问http://localhost:8081/big2.html

利润情况信息

前端

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>利润情况信息</title>
  6. <!-- 引入 echarts.js -->
  7. <script src="/js/echarts.min.js"></script>
  8. <script src="/js/jquery-3.5.1.min.js"></script>
  9. <style>
  10. html, body {
  11. height: 100%;
  12. margin: 0;
  13. padding: 0;
  14. }
  15. #main {
  16. width: 100%;
  17. height: 100%;
  18. min-height: 300px; /* 设置最小高度,防止内容过小时显示异常 */
  19. }
  20. </style>
  21. </head>
  22. <body>
  23. <!-- 为ECharts准备一个具备大小(宽高)的Dom -->
  24. <div id="main"></div>
  25. <script type="text/javascript">
  26. var chartDom = document.getElementById('main');
  27. var myChart = echarts.init(chartDom);
  28. var option;
  29. // 监听窗口大小变化事件
  30. window.addEventListener('resize', function() {
  31. myChart.resize(); // 调整图表大小
  32. });
  33. option = {
  34. title: {
  35. text: '利润情况信息',
  36. textStyle: {
  37. textAlign: 'center'
  38. }
  39. },
  40. tooltip: {
  41. trigger: 'axis',
  42. axisPointer: {
  43. type: 'shadow'
  44. }
  45. },
  46. legend: {
  47. data: ['利润', '费用', '收入']
  48. },
  49. grid: {
  50. left: '3%',
  51. right: '4%',
  52. bottom: '3%',
  53. containLabel: true
  54. },
  55. xAxis: [
  56. {
  57. type: 'value'
  58. }
  59. ],
  60. yAxis: [
  61. {
  62. type: 'category',
  63. axisTick: {
  64. show: false
  65. },
  66. data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
  67. }
  68. ],
  69. series: [
  70. {
  71. name: 'Profit',
  72. type: 'bar',
  73. label: {
  74. show: true,
  75. position: 'inside'
  76. },
  77. emphasis: {
  78. focus: 'series'
  79. },
  80. data: [200, 170, 240, 244, 200, 220, 210]
  81. },
  82. {
  83. name: 'Income',
  84. type: 'bar',
  85. stack: 'Total',
  86. label: {
  87. show: true
  88. },
  89. emphasis: {
  90. focus: 'series'
  91. },
  92. itemStyle: {
  93. emphasis: {
  94. shadowBlur: 10,
  95. shadowOffsetX: 0,
  96. shadowColor: 'rgba(0, 0, 0, 0.5)'
  97. },
  98. normal:{
  99. color:function(params) {
  100. //自定义颜色
  101. var colorList = ['#00FFFF', '#00FF00', '#FFFF00', '#FF8C00', '#FF0000', '#FE8463','#6495ed','#ff69b4','#00FFFF', '#00FF00', '#FFFF00', '#FF8C00', '#FF0000', '#FE8463','#6495ed','#ff69b4'];
  102. return colorList[params.dataIndex]
  103. }
  104. }
  105. },
  106. data: [320, 302, 341, 374, 390, 450, 420]
  107. },
  108. {
  109. name: 'Expenses',
  110. type: 'bar',
  111. stack: 'Total',
  112. label: {
  113. show: true,
  114. position: 'left'
  115. },
  116. emphasis: {
  117. focus: 'series'
  118. },
  119. itemStyle: {
  120. emphasis: {
  121. shadowBlur: 10,
  122. shadowOffsetX: 0,
  123. shadowColor: 'rgba(0, 0, 0, 0.5)'
  124. },
  125. normal:{
  126. color:function(params) {
  127. //自定义颜色
  128. var colorList = ['#00FFFF', '#00FF00', '#FFFF00', '#FF8C00', '#FF0000', '#FE8463','#6495ed','#ff69b4','#00FFFF', '#00FF00', '#FFFF00', '#FF8C00', '#FF0000', '#FE8463','#6495ed','#ff69b4'];
  129. return colorList[params.dataIndex]
  130. }
  131. }
  132. },
  133. data: [-120, -132, -101, -134, -190, -230, -210]
  134. }
  135. ]
  136. };
  137. option && myChart.setOption(option);
  138. </script>
  139. </body>

验证页面:运行项目,浏览器访问http://localhost:8081/negative.html

虚拟柱状图

前端

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>虚拟柱状图</title>
  6. <script src="/js/echarts.min.js"></script>
  7. <script src="/js/jquery-3.5.1.min.js"></script>
  8. <style>
  9. html, body {
  10. height: 100%;
  11. margin: 0;
  12. padding: 0;
  13. }
  14. #main {
  15. width: 100%;
  16. height: 100%;
  17. min-height: 300px; /* 设置最小高度,防止内容过小时显示异常 */
  18. }
  19. </style>
  20. </head>
  21. <body>
  22. <div id="main"></div>
  23. <script type="text/javascript">
  24. var chartDom = document.getElementById('main');
  25. var myChart = echarts.init(chartDom);
  26. var option;
  27. // 监听窗口大小变化事件
  28. window.addEventListener('resize', function() {
  29. myChart.resize(); // 调整图表大小
  30. });
  31. // Generate data
  32. let category = [];
  33. let dottedBase = +new Date();
  34. let lineData = [];
  35. let barData = [];
  36. for (let i = 0; i < 20; i++) {
  37. let date = new Date((dottedBase += 3600 * 24 * 1000));
  38. category.push(
  39. [date.getFullYear(), date.getMonth() + 1, date.getDate()].join('-')
  40. );
  41. let b = Math.random() * 200;
  42. let d = Math.random() * 200;
  43. barData.push(b);
  44. lineData.push(d + b);
  45. }
  46. // option
  47. option = {
  48. title: {
  49. text: '虚拟柱状',
  50. textStyle: {
  51. textAlign: 'center'
  52. }
  53. },
  54. backgroundColor: '',
  55. tooltip: {
  56. trigger: 'axis',
  57. axisPointer: {
  58. type: 'shadow'
  59. }
  60. },
  61. legend: {
  62. data: ['line', 'bar'],
  63. textStyle: {
  64. color: '#ccc'
  65. }
  66. },
  67. xAxis: {
  68. data: category,
  69. axisLine: {
  70. lineStyle: {
  71. color: '#ccc'
  72. }
  73. }
  74. },
  75. yAxis: {
  76. splitLine: { show: false },
  77. axisLine: {
  78. lineStyle: {
  79. color: '#ccc'
  80. }
  81. }
  82. },
  83. series: [
  84. {
  85. name: 'line',
  86. type: 'line',
  87. smooth: true,
  88. showAllSymbol: true,
  89. symbol: 'emptyCircle',
  90. symbolSize: 5,
  91. data: lineData
  92. },
  93. {
  94. name: 'bar',
  95. type: 'bar',
  96. barWidth: 10,
  97. itemStyle: {
  98. borderRadius: 5,
  99. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  100. { offset: 0, color: '#14c8d4' },
  101. { offset: 1, color: '#43eec6' }
  102. ])
  103. },
  104. data: barData
  105. },
  106. {
  107. name: 'line',
  108. type: 'bar',
  109. barGap: '-100%',
  110. barWidth: 10,
  111. itemStyle: {
  112. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  113. { offset: 0, color: 'rgba(20,200,212,0.5)' },
  114. { offset: 0.2, color: 'rgba(20,200,212,0.2)' },
  115. { offset: 1, color: 'rgba(20,200,212,0)' }
  116. ])
  117. },
  118. z: -12,
  119. data: lineData
  120. },
  121. {
  122. name: 'dotted',
  123. type: 'pictorialBar',
  124. symbol: 'rect',
  125. itemStyle: {
  126. color: '#0f375f'
  127. },
  128. symbolRepeat: true,
  129. symbolSize: [12, 4],
  130. symbolMargin: 1,
  131. z: -10,
  132. data: lineData
  133. }
  134. ]
  135. };
  136. option && myChart.setOption(option);
  137. </script>
  138. </body>

验证页面:运行项目,浏览器访问http://localhost:8081/histogram.html

平均支付时间统计

后端

  1. import org.springframework.beans.factory.annotation.Autowired;
  2. import org.springframework.jdbc.core.JdbcTemplate;
  3. import org.springframework.web.bind.annotation.GetMapping;
  4. import org.springframework.web.bind.annotation.RestController;
  5. import java.util.ArrayList;
  6. import java.util.HashMap;
  7. import java.util.List;
  8. import java.util.Map;
  9. @RestController
  10. public class Big3Controller {
  11. private final JdbcTemplate jdbcTemplate;
  12. @Autowired
  13. public Big3Controller(JdbcTemplate jdbcTemplate) {
  14. this.jdbcTemplate = jdbcTemplate;
  15. }
  16. @GetMapping("/chart-data3")
  17. public Map<String, Object> getChartData() {
  18. String query = "SELECT dt, payment_avg_time FROM ads_payment_daycount";
  19. List<Map<String, Object>> result = jdbcTemplate.queryForList(query);
  20. List<String> labels = new ArrayList<>();
  21. List<Integer> values = new ArrayList<>();
  22. for (Map<String, Object> row : result) {
  23. String dt = row.get("dt").toString();
  24. Integer paymentAvgTime = ((Number) row.get("payment_avg_time")).intValue();
  25. labels.add(dt);
  26. values.add(paymentAvgTime);
  27. }
  28. Map<String, Object> data = new HashMap<>();
  29. data.put("labels", labels);
  30. data.put("values", values);
  31. return data;
  32. }
  33. }

 验证接口:运行项目,浏览器访问http://localhost:8081/chart-data3

前端

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>平均支付时间统计</title>
  5. <meta charset="UTF-8">
  6. <script src="https://cdn.jsdelivr.net/npm/echarts@5.2.2/dist/echarts.min.js"></script>
  7. <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
  8. <style>
  9. html, body {
  10. height: 100%;
  11. margin: 0;
  12. padding: 0;
  13. }
  14. #chart {
  15. width: 100%;
  16. height: 100%;
  17. min-height: 300px; /* 设置最小高度,防止内容过小时显示异常 */
  18. }
  19. </style>
  20. </head>
  21. <body>
  22. <div id="chart"></div>
  23. <script type="text/javascript">
  24. var chart = echarts.init(document.getElementById('chart'));
  25. // 监听窗口大小变化事件
  26. window.addEventListener('resize', function() {
  27. chart.resize(); // 调整图表大小
  28. });
  29. // 使用Ajax异步获取数据
  30. $.ajax({
  31. url: '/chart-data3',
  32. type: 'GET',
  33. dataType: 'json',
  34. success: function(data) {
  35. var option = {
  36. title: {
  37. text: '平均支付时间统计',
  38. textStyle: {
  39. textAlign: 'center'
  40. }
  41. },
  42. tooltip: {},
  43. angleAxis: {},
  44. radiusAxis: {
  45. type: 'category',
  46. data: data.labels
  47. },
  48. polar: {},
  49. series: [{
  50. name: 'Avg Time',
  51. type: 'bar',
  52. data: data.values,
  53. coordinateSystem: 'polar',
  54. itemStyle: {
  55. color: function(params) {
  56. // 设置背景颜色
  57. var colorList = ['#C1232B', '#B5C334', '#FCCE10', '#E87C25', '#27727B', '#FE8463', '#9BCA63', '#FAD860', '#F3A43B', '#60C0DD'];
  58. return colorList[params.dataIndex % colorList.length];
  59. }
  60. }
  61. }]
  62. };
  63. chart.setOption(option);
  64. }
  65. });
  66. </script>
  67. </body>
  68. </html>

 验证页面:运行项目,浏览器访问​​​​​​​http://localhost:8081/big3.html

订单金额统计

后端

  1. import org.springframework.beans.factory.annotation.Autowired;
  2. import org.springframework.jdbc.core.JdbcTemplate;
  3. import org.springframework.web.bind.annotation.GetMapping;
  4. import org.springframework.web.bind.annotation.RestController;
  5. import java.util.ArrayList;
  6. import java.util.HashMap;
  7. import java.util.List;
  8. import java.util.Map;
  9. @RestController
  10. public class Big4Controller {
  11. private final JdbcTemplate jdbcTemplate;
  12. @Autowired
  13. public Big4Controller(JdbcTemplate jdbcTemplate) {
  14. this.jdbcTemplate = jdbcTemplate;
  15. }
  16. @GetMapping("/chart-data4")
  17. public Map<String, Object> getChartData() {
  18. String query = "SELECT dt, order_amount FROM ads_payment_daycount";
  19. List<Map<String, Object>> result = jdbcTemplate.queryForList(query);
  20. List<String> labels = new ArrayList<>();
  21. List<Integer> values = new ArrayList<>();
  22. for (Map<String, Object> row : result) {
  23. String dt = row.get("dt").toString();
  24. Integer orderAmount = ((Number) row.get("order_amount")).intValue();
  25. labels.add(dt);
  26. values.add(orderAmount);
  27. }
  28. Map<String, Object> data = new HashMap<>();
  29. data.put("labels", labels);
  30. data.put("values", values);
  31. return data;
  32. }
  33. }

 验证接口:运行项目,浏览器访问​​​​​​​​​​​​​​http://localhost:8081/chart-data4

前端

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>订单金额统计</title>
  5. <meta charset="UTF-8">
  6. <script src="https://cdn.jsdelivr.net/npm/echarts@5.2.2/dist/echarts.min.js"></script>
  7. <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
  8. <style>
  9. html, body {
  10. height: 100%;
  11. margin: 0;
  12. padding: 0;
  13. }
  14. #chart {
  15. width: 100%;
  16. height: 100%;
  17. min-height: 300px;
  18. }
  19. </style>
  20. </head>
  21. <body>
  22. <div id="chart"></div>
  23. <script type="text/javascript">
  24. var chart = echarts.init(document.getElementById('chart'));
  25. // 监听窗口大小变化事件
  26. window.addEventListener('resize', function() {
  27. chart.resize(); // 调整图表大小
  28. });
  29. // 使用Ajax异步获取数据
  30. $.ajax({
  31. url: '/chart-data4',
  32. type: 'GET',
  33. dataType: 'json',
  34. success: function(data) {
  35. var option = {
  36. title: {
  37. text: '订单金额统计',
  38. textStyle: {
  39. textAlign: 'center'
  40. }
  41. },
  42. tooltip: {
  43. trigger: 'item',
  44. formatter: '{b}: {c} ({d}%)'
  45. },
  46. series: [{
  47. name: '订单金额',
  48. type: 'pie',
  49. radius: '50%',
  50. data: data.values.map(function(value, index) {
  51. return {
  52. name: data.labels[index],
  53. value: value
  54. };
  55. })
  56. }]
  57. };
  58. chart.setOption(option);
  59. }
  60. });
  61. </script>
  62. </body>
  63. </html>

验证页面:运行项目,浏览器访问​​​​​​​http://localhost:8081/big4.html

旭日图

前端

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>旭日图</title>
  6. <!-- 引入 echarts.js 和 jQuery(CDN引用) -->
  7. <script src="https://cdn.jsdelivr.net/npm/echarts@5.2.2/dist/echarts.min.js"></script>
  8. <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
  9. <style>
  10. html, body {
  11. height: 100%;
  12. margin: 0;
  13. padding: 0;
  14. }
  15. #main {
  16. width: 100%;
  17. height: 100%;
  18. min-height: 300px; /* 设置最小高度,防止内容过小时显示异常 */
  19. }
  20. </style>
  21. </head>
  22. <body>
  23. <!-- 为ECharts准备一个具备大小(宽高)的Dom -->
  24. <div id="main"></div>
  25. <script type="text/javascript">
  26. var chartDom = document.getElementById('main');
  27. var myChart = echarts.init(chartDom);
  28. var option;
  29. option = {
  30. title: {
  31. text: '旭日图',
  32. textStyle: {
  33. textAlign: 'center'
  34. }
  35. },
  36. silent: true,
  37. series: [
  38. {
  39. radius: ['15%', '80%'],
  40. type: 'sunburst',
  41. sort: undefined,
  42. emphasis: {
  43. focus: 'ancestor'
  44. },
  45. data: [
  46. {
  47. value: 8,
  48. children: [
  49. {
  50. value: 4,
  51. children: [
  52. {
  53. value: 2
  54. },
  55. {
  56. value: 1
  57. },
  58. {
  59. value: 1
  60. },
  61. {
  62. value: 0.5
  63. }
  64. ]
  65. },
  66. {
  67. value: 2
  68. }
  69. ]
  70. },
  71. {
  72. value: 4,
  73. children: [
  74. {
  75. children: [
  76. {
  77. value: 2
  78. }
  79. ]
  80. }
  81. ]
  82. },
  83. {
  84. value: 4,
  85. children: [
  86. {
  87. children: [
  88. {
  89. value: 2
  90. }
  91. ]
  92. }
  93. ]
  94. },
  95. {
  96. value: 3,
  97. children: [
  98. {
  99. children: [
  100. {
  101. value: 1
  102. }
  103. ]
  104. }
  105. ]
  106. }
  107. ],
  108. label: {
  109. color: '#000',
  110. textBorderColor: '#fff',
  111. textBorderWidth: 2,
  112. formatter: function (param) {
  113. var depth = param.treePathInfo.length;
  114. if (depth === 2) {
  115. return 'radial';
  116. } else if (depth === 3) {
  117. return 'tangential';
  118. } else if (depth === 4) {
  119. return '0';
  120. }
  121. return '';
  122. }
  123. },
  124. levels: [
  125. {},
  126. {
  127. itemStyle: {
  128. color: '#CD4949'
  129. },
  130. label: {
  131. rotate: 'radial'
  132. }
  133. },
  134. {
  135. itemStyle: {
  136. color: '#F47251'
  137. },
  138. label: {
  139. rotate: 'tangential'
  140. }
  141. },
  142. {
  143. itemStyle: {
  144. color: '#FFC75F'
  145. },
  146. label: {
  147. rotate: 0
  148. }
  149. }
  150. ]
  151. }
  152. ]
  153. };
  154. option && myChart.setOption(option);
  155. </script>
  156. </body>
  157. </html>

五、大屏编写

前端

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>大屏可视化6</title>
  6. <style>
  7. /* CSS样式 */
  8. body, html {
  9. height: 100%;
  10. margin: 0;
  11. padding: 0;
  12. background-color: cornflowerblue;
  13. }
  14. #header {
  15. width: 100%;
  16. height: 8%;
  17. display: flex;
  18. justify-content: center;
  19. align-items: center;
  20. background-color: cyan;
  21. font-size: 24px;
  22. font-weight: bold;
  23. }
  24. #content {
  25. width: 100%;
  26. height: 90%;
  27. display: flex;
  28. flex-wrap: wrap;
  29. justify-content: space-around;
  30. align-items: center;
  31. }
  32. .chart-container {
  33. width: 32%;
  34. height: 48%;
  35. background-color: aquamarine;
  36. margin-bottom: 20px;
  37. box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.2);
  38. }
  39. </style>
  40. </head>
  41. <body>
  42. <div id="header">电商数据情况大屏</div>
  43. <div id="content">
  44. <div class="chart-container" id="chart1">
  45. <iframe src="negative.html" style="width: 100%; height: 100%; border: none;"></iframe>
  46. </div>
  47. <div class="chart-container" id="chart2">
  48. <iframe src="big2.html" style="width: 100%; height: 100%; border: none;"></iframe>
  49. </div>
  50. <div class="chart-container" id="chart3">
  51. <iframe src="histogram.html" style="width: 100%; height: 100%; border: none;"></iframe>
  52. </div>
  53. <div class="chart-container" id="chart4">
  54. <iframe src="big3.html" style="width: 100%; height: 100%; border: none;"></iframe>
  55. </div>
  56. <div class="chart-container" id="chart5">
  57. <iframe src="big4.html" style="width: 100%; height: 100%; border: none;"></iframe>
  58. </div>
  59. <div class="chart-container" id="chart6">
  60. <iframe src="yun.html" style="width: 100%; height: 100%; border: none;"></iframe>
  61. </div>
  62. </div>
  63. <script src="https://cdn.jsdelivr.net/npm/d3@7.0.0/dist/d3.min.js"></script>
  64. <script>
  65. </script>
  66. </body>
  67. </html>

运行项目,浏览器访问​​​​​​​http://localhost:8081/yun.html

注:http://localhost:8080/加上HTML的文件名都能够查看相应的图!

要码源的私聊/评论留下邮箱号,压缩包包括项目源码、数据sql文件,readme.txt。

声明:作品仅可作学习使用​​​​​​​。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/笔触狂放9/article/detail/362475
推荐阅读
相关标签
  

闽ICP备14008679号