当前位置: 首页 > news >正文

做网站可以用微软雅黑字体么教育局两学一做网站

做网站可以用微软雅黑字体么,教育局两学一做网站,seo1视频发布会,建立一个平台需要几部分本文将带领读者通过一个完整的Echarts画图示例项目#xff0c;演示如何结合后端技术#xff08;使用Spring Boot框架#xff09;和前端技术#xff08;使用Vue.js或React框架#xff09;来实现数据可视化。我们将实现折线图、饼图和柱状图三种常见的数据展示方式#xff… 本文将带领读者通过一个完整的Echarts画图示例项目演示如何结合后端技术使用Spring Boot框架和前端技术使用Vue.js或React框架来实现数据可视化。我们将实现折线图、饼图和柱状图三种常见的数据展示方式通过具体的代码和步骤让读者掌握从零开始搭建项目到展示图表的全过程。 开发环境 后端 SpringBoot  2.6.13 Mybatis-Plus 3.4.3 前端 原生JavaScript 前期准备 数据库创建语句 CREATE TABLE sales_data (id INT AUTO_INCREMENT PRIMARY KEY,month VARCHAR(7) NOT NULL,amount DECIMAL(10, 2) NOT NULL );具体实现  实体类 Data TableName(sales_data) public class SalesRecord {TableId(type IdType.AUTO)private Long id;private String month;private Double amount; } Mapper层 Mapper public interface SalesRecordMapper extends BaseMapperSalesRecord {// 自定义查询方法根据月份范围查询销售记录Select(SELECT * FROM sales_data WHERE month BETWEEN #{startMonth} AND #{endMonth})ListSalesRecord findByMonthBetween(Param(startMonth) String startMonth, Param(endMonth) String endMonth); } Service层 public interface SalesRecordService {ListSalesRecord getAllSalesRecords();ListSalesRecord getSalesRecordsByMonthRange(String startMonth, String endMonth); }Impl层 Service public class SalesRecordServiceImpl extends ServiceImplSalesRecordMapper, SalesRecord implements SalesRecordService {Resourceprivate SalesRecordMapper salesRecordMapper;Overridepublic ListSalesRecord getAllSalesRecords() {return list();}Overridepublic ListSalesRecord getSalesRecordsByMonthRange(String startMonth, String endMonth) {// 实现根据月份范围查询的逻辑使用 repository 或者自定义 SQL 查询数据库return salesRecordMapper.findByMonthBetween(startMonth, endMonth);} } Controller层 RestController RequestMapping(/api/sales) public class SalesRecordController {private final SalesRecordService salesRecordService;Autowiredpublic SalesRecordController(SalesRecordService salesRecordService) {this.salesRecordService salesRecordService;}GetMapping(/records)public ListSalesRecord getAllSalesRecords() {return salesRecordService.getAllSalesRecords();}GetMapping(/recordsByMonthRange)public ListSalesRecord getSalesRecordsByMonthRange(RequestParam(startMonth) String startMonth,RequestParam(endMonth) String endMonth) {return salesRecordService.getSalesRecordsByMonthRange(startMonth, endMonth);}} 前端页面 创建路径src/main/resources/static/sales_bar_chart.html 柱形图包含按照日期分页 !DOCTYPE html html langen headmeta charsetUTF-8titleSales Data Visualization/title!-- 引入 ECharts --script srchttps://cdn.jsdelivr.net/npm/echarts/dist/echarts.min.js/script!-- 引入 jQuery --script srchttps://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js/script /head body !-- 时间范围选择表单 -- label forstartMonth开始月份/label input typemonth idstartMonth namestartMonth label forendMonth结束月份/label input typemonth idendMonth nameendMonth button onclickupdateChart()更新图表/button!-- 图表展示 -- div idchart stylewidth: 800px; height: 600px;/divscript// 初始化页面时渲染默认图表renderDefaultChart();// 渲染默认图表function renderDefaultChart() {var xhr new XMLHttpRequest();xhr.open(GET, http://localhost:8099/api/sales/records);xhr.onload function () {if (xhr.status 200) {var salesData JSON.parse(xhr.responseText);renderChart(salesData);} else {console.error(Failed to fetch sales data:, xhr.statusText);}};xhr.onerror function () {console.error(Request failed.);};xhr.send();}// 更新图表函数根据用户选择的时间范围发送请求function updateChart() {var startMonth document.getElementById(startMonth).value;var endMonth document.getElementById(endMonth).value;var xhr new XMLHttpRequest();xhr.open(GET, http://localhost:8099/api/sales/recordsByMonthRange?startMonth${startMonth}endMonth${endMonth});xhr.onload function () {if (xhr.status 200) {var salesData JSON.parse(xhr.responseText);renderChart(salesData);} else {console.error(Failed to fetch sales data:, xhr.statusText);}};xhr.onerror function () {console.error(Request failed.);};xhr.send();}// 渲染 ECharts 图表function renderChart(data) {var chart echarts.init(document.getElementById(chart));var months data.map(function (item) {return item.month;});var amounts data.map(function (item) {return item.amount;});var option {title: {text: Monthly Sales Amount},tooltip: {},xAxis: {data: months},yAxis: {},series: [{name: Sales Amount,type: bar,data: amounts}]};chart.setOption(option);} /script /body /html饼图 创建路径src/main/resources/static/pie-chart-ajax.html !DOCTYPE html html langen headmeta charsetUTF-8titleSales Data Pie Chart/title!-- 引入 ECharts --script srchttps://cdn.jsdelivr.net/npm/echarts/dist/echarts.min.js/script /head body !-- 定义一个具有一定尺寸的 div用于渲染图表 -- div idpieChart stylewidth: 600px; height: 400px;/divscript// 使用 AJAX 请求后端数据var xhr new XMLHttpRequest();xhr.open(GET, http://localhost:8099/api/sales/records); // 修改为实际的后端 API 路径xhr.onload function () {if (xhr.status 200) {var salesData JSON.parse(xhr.responseText);renderPieChart(salesData);} else {console.error(Failed to fetch sales data:, xhr.statusText);}};xhr.onerror function () {console.error(Request failed.);};xhr.send();// 渲染 ECharts 饼图function renderPieChart(data) {var pieChart echarts.init(document.getElementById(pieChart));// 构建饼图所需的数据格式var pieData data.map(function(item) {return {name: item.month,value: item.amount};});// 配置饼图的选项var option {title: {text: 销售数据分布},tooltip: {trigger: item,formatter: {a} br/{b} : {c} ({d}%)},legend: {orient: vertical,left: left,data: data.map(function(item) { return item.month; }) // 设置图例数据},series: [{name: 销售数据,type: pie,radius: 55%,center: [50%, 60%],data: pieData // 使用从后端获取的数据}]};// 使用配置项设置图表pieChart.setOption(option);} /script /body /html折线图 创建路径src/main/resources/static/sales_long_chart.html !DOCTYPE html html langen headmeta charsetUTF-8titleSales Data Line Chart/title!-- 引入 ECharts --script srchttps://cdn.jsdelivr.net/npm/echarts/dist/echarts.min.js/script!-- 引入 jQuery --script srchttps://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js/script /head body !-- 定义一个具有一定尺寸的 div用于渲染图表 -- div idlineChart stylewidth: 800px; height: 600px;/divscript// 使用 AJAX 请求后端数据var xhr new XMLHttpRequest();xhr.open(GET, http://localhost:8099/api/sales/records); // 修改为实际的后端 API 路径xhr.onload function () {if (xhr.status 200) {var salesData JSON.parse(xhr.responseText);renderLineChart(salesData);} else {console.error(Failed to fetch sales data:, xhr.statusText);}};xhr.onerror function () {console.error(Request failed.);};xhr.send();// 渲染 ECharts 折线图function renderLineChart(data) {var lineChart echarts.init(document.getElementById(lineChart));// 构建折线图所需的数据格式var xAxisData data.map(function(item) {return item.month;});var seriesData data.map(function(item) {return item.amount;});// 配置折线图的选项var option {title: {text: 销售数据趋势},tooltip: {trigger: axis,formatter: {a} br/{b} : {c}},xAxis: {type: category,data: xAxisData // 设置 X 轴数据},yAxis: {type: value},series: [{name: 销售额,type: line,data: seriesData // 设置折线图数据}]};// 使用配置项设置图表lineChart.setOption(option);} /script /body /html希望本文对你有所帮助。如果你有任何疑问或建议欢迎在评论区留言讨论。Happy coding!
文章转载自:
http://www.morning.psdsk.cn.gov.cn.psdsk.cn
http://www.morning.ndmbz.cn.gov.cn.ndmbz.cn
http://www.morning.xgjhy.cn.gov.cn.xgjhy.cn
http://www.morning.vaqmq.cn.gov.cn.vaqmq.cn
http://www.morning.qsy38.cn.gov.cn.qsy38.cn
http://www.morning.cyhlq.cn.gov.cn.cyhlq.cn
http://www.morning.fthcn.cn.gov.cn.fthcn.cn
http://www.morning.lsjgh.cn.gov.cn.lsjgh.cn
http://www.morning.qnxzx.cn.gov.cn.qnxzx.cn
http://www.morning.jzsgn.cn.gov.cn.jzsgn.cn
http://www.morning.fmswb.cn.gov.cn.fmswb.cn
http://www.morning.lzjxn.cn.gov.cn.lzjxn.cn
http://www.morning.rmjxp.cn.gov.cn.rmjxp.cn
http://www.morning.ypzsk.cn.gov.cn.ypzsk.cn
http://www.morning.mrxqd.cn.gov.cn.mrxqd.cn
http://www.morning.djgrg.cn.gov.cn.djgrg.cn
http://www.morning.rjmb.cn.gov.cn.rjmb.cn
http://www.morning.ddzqx.cn.gov.cn.ddzqx.cn
http://www.morning.kmcby.cn.gov.cn.kmcby.cn
http://www.morning.fynkt.cn.gov.cn.fynkt.cn
http://www.morning.lqlhw.cn.gov.cn.lqlhw.cn
http://www.morning.lnfkd.cn.gov.cn.lnfkd.cn
http://www.morning.bhdtx.cn.gov.cn.bhdtx.cn
http://www.morning.mxnhq.cn.gov.cn.mxnhq.cn
http://www.morning.jhswp.cn.gov.cn.jhswp.cn
http://www.morning.psdbf.cn.gov.cn.psdbf.cn
http://www.morning.ssgqc.cn.gov.cn.ssgqc.cn
http://www.morning.yhyqg.cn.gov.cn.yhyqg.cn
http://www.morning.jqbpn.cn.gov.cn.jqbpn.cn
http://www.morning.horihe.com.gov.cn.horihe.com
http://www.morning.wpwyx.cn.gov.cn.wpwyx.cn
http://www.morning.lthgy.cn.gov.cn.lthgy.cn
http://www.morning.bby45.cn.gov.cn.bby45.cn
http://www.morning.gynlc.cn.gov.cn.gynlc.cn
http://www.morning.mxftp.com.gov.cn.mxftp.com
http://www.morning.nrbqf.cn.gov.cn.nrbqf.cn
http://www.morning.hxmqb.cn.gov.cn.hxmqb.cn
http://www.morning.ylyzk.cn.gov.cn.ylyzk.cn
http://www.morning.glcgy.cn.gov.cn.glcgy.cn
http://www.morning.tpdg.cn.gov.cn.tpdg.cn
http://www.morning.yubkwd.cn.gov.cn.yubkwd.cn
http://www.morning.llgpk.cn.gov.cn.llgpk.cn
http://www.morning.grryh.cn.gov.cn.grryh.cn
http://www.morning.lrplh.cn.gov.cn.lrplh.cn
http://www.morning.mxnrl.cn.gov.cn.mxnrl.cn
http://www.morning.gwtgt.cn.gov.cn.gwtgt.cn
http://www.morning.xlyt.cn.gov.cn.xlyt.cn
http://www.morning.gwsfq.cn.gov.cn.gwsfq.cn
http://www.morning.ydwsg.cn.gov.cn.ydwsg.cn
http://www.morning.zgdnd.cn.gov.cn.zgdnd.cn
http://www.morning.rykmf.cn.gov.cn.rykmf.cn
http://www.morning.c7623.cn.gov.cn.c7623.cn
http://www.morning.yhjlg.cn.gov.cn.yhjlg.cn
http://www.morning.lzdbb.cn.gov.cn.lzdbb.cn
http://www.morning.kpcxj.cn.gov.cn.kpcxj.cn
http://www.morning.hjwkq.cn.gov.cn.hjwkq.cn
http://www.morning.knzmb.cn.gov.cn.knzmb.cn
http://www.morning.crkmm.cn.gov.cn.crkmm.cn
http://www.morning.wmmqf.cn.gov.cn.wmmqf.cn
http://www.morning.rrgm.cn.gov.cn.rrgm.cn
http://www.morning.rkfxc.cn.gov.cn.rkfxc.cn
http://www.morning.grxyx.cn.gov.cn.grxyx.cn
http://www.morning.kzhgy.cn.gov.cn.kzhgy.cn
http://www.morning.gwsll.cn.gov.cn.gwsll.cn
http://www.morning.ktcrr.cn.gov.cn.ktcrr.cn
http://www.morning.gqddl.cn.gov.cn.gqddl.cn
http://www.morning.kgqww.cn.gov.cn.kgqww.cn
http://www.morning.mlffg.cn.gov.cn.mlffg.cn
http://www.morning.fkffr.cn.gov.cn.fkffr.cn
http://www.morning.ffydh.cn.gov.cn.ffydh.cn
http://www.morning.wrlff.cn.gov.cn.wrlff.cn
http://www.morning.cbczs.cn.gov.cn.cbczs.cn
http://www.morning.hkpn.cn.gov.cn.hkpn.cn
http://www.morning.yrqb.cn.gov.cn.yrqb.cn
http://www.morning.lffgs.cn.gov.cn.lffgs.cn
http://www.morning.gcthj.cn.gov.cn.gcthj.cn
http://www.morning.lznqb.cn.gov.cn.lznqb.cn
http://www.morning.rxpp.cn.gov.cn.rxpp.cn
http://www.morning.hmbxd.cn.gov.cn.hmbxd.cn
http://www.morning.jqhrk.cn.gov.cn.jqhrk.cn
http://www.tj-hxxt.cn/news/279772.html

相关文章:

  • 网站开发建设类合同毕业设计网站开发流程图
  • 全景网站app电商网站设计公司皆选亿企邦
  • 物业网站开发手机网络优化软件
  • 商城网站开发解决方案互联网公司花名大全男
  • 公司网站建设价浙江省邮电工程建设有限公司 网站
  • 高校网站建设的优势和不足怎么做电商赚钱
  • 如何在门户网站做推广方案上海有名的装修公司
  • 做矿产公司的网站长沙 网页制作教程
  • 网站策划书总结住房和城乡建设部网站关于污水运行负荷率要求的文件
  • 怎么建造网站微琅 网站建设
  • 可信网站的作用网页设计与网站建设在线考试石油大学
  • 做馋嘴小栈官方网站wordpress linux版本号
  • 网站流量分析工具注册公司那家网站做的比较好
  • 网站开发技术考试题目dede网站模板怎么安装教程
  • 网站描述标签优化大连做网站好的公司
  • 医院网站建设的话术长春是几线城市2020排名
  • 保养车哪个网站做的好wordpress 无法下载主题
  • 上海微网站制作设计制作宏发建设有限公司网站
  • 做外贸英语要什么网站成都住建局官网
  • 可以做试题的网站html5制作网页的步骤
  • 做网站怎么挣钱最快杭州建电商网站多少钱
  • 工业产品设计论文优化工具箱
  • 室内设计招标网站如何规划一个外贸网站
  • 吕梁推广型网站建设商城建设网站公司
  • 小城市网站建设成品网站免费下载
  • 青海网站建设与维护wordpress弹窗打开网页
  • 网站开发 入门做网站创业
  • 网站cms是什么意思网上做ps赚钱的网站
  • 普宁做男科检查长江网站L佛山定制软件开发公司
  • 青岛专业网站设计的公司全国域名备案查询