今天给大家带来的是一个用SpringBoot + thymeleaf显示出饼状图和柱形图
首先我们先创建项目 注意:创建SpringBoot项目时一定要联网不然会报错
项目创建好后我们首先对 application.yml 进行编译
#指定端口号
server:
port: 8888
#配置mysql数据源
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/nba?serverTimezone=Asia/Shanghai
username: root
password: root
#配置模板引擎 thymeleaf
thymeleaf:
mode: HTML5
cache: false
suffix: .html
prefix: classpath:/templates/
mybatis:
mapper-locations: classpath:/mapper/*.xml
type-aliases-package: com.bdqn.springboot #放包名
接下来我们写后端代码
mapper层
<