<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>echarts组件</title>
<style>
#test{
margin: 20px;
width: 700px;
height: 500px;
}
</style>
</head>
<body>
<!--建立dom 容器-->
<div id="test"></div>
<!--引入echarts-->
<script src="https://lib.baomitu.com/echarts/4.7.0/echarts.min.js"></script>
<script>
/*基于准备好的dom,初始化echarts实例*/
const myChart = echarts.init(document.getElementById('test'));
/*指定图表的配置项和数据*/
const option = {
/*标题 title {}
* 主标题 text
* 副标题 subtext
* 位置 left
* left 左对齐
* right 右对齐
* center 居中
* 主标题样式 textStyle
* color
* fontSize
* 副标题样式 subtextStyle
echarts组件
最新推荐文章于 2023-06-29 23:17:07 发布