1 Star 1 Fork 6

Ooooh/Echarts-Demo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
ECharts使用步骤.html 1.30 KB
一键复制 编辑 原始数据 按行查看 历史
Ooooh 提交于 2020-06-29 09:17 . echarts-demo
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<style>
.box {
width: 300px;
height: 300px;
background-color: bisque;
}
</style>
</head>
<body>
<!-- 2_准备一个具有大小的盒子 -->
<div class="box"></div>
<!-- 1_引入echarts.js -->
<script src="js/echarts.min.js"></script>
<!-- 3_初始化 -->
<script>
// 初始化实例对象 echarts.init(dom容器)
var myChart = echarts.init(document.querySelector(".box"));
// 4_指定配置项option 和数据
var option = {
title: {
text: "ECharts 入门示例",
},
tooltip: {},
legend: {
data: ["销量"],
},
xAxis: {
data: ["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"],
},
yAxis: {},
series: [
{
name: "销量",
type: "bar",
data: [5, 20, 36, 10, 10, 20],
},
],
};
// 5_将配置项设置给echarts实例对象
myChart.setOption(option);
</script>
</body>
</html>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/nichan-13/Echarts-Demo.git
git@gitee.com:nichan-13/Echarts-Demo.git
nichan-13
Echarts-Demo
Echarts-Demo
master

搜索帮助