echarts

echarts

定义

  1. javascript的图表的库
  2. 百度捐给apache基金会
  3. 比较符合中国人习惯
  4. HeightCharts,D3为同行

核心概览

instance实例
series系列
tooltip 提示
legend 图例
xAxis x轴
yAxis y轴
toolbox 工具箱
dataZoom 缩放
vitualMap 虚拟映射

图标常用类型

bar 柱状
pie 饼型— radius:[“60%”,40%]
line 线性 --areaStyle 面 smooth:true 平滑

颜色的修改

主题:自定义颜色

light,dark浅色与深色

自定义主题

自定义主题地址

color:调色盘
color系列调色盘
itemStyle normal 默认 emphasis 强调状态

特别样式

渐变
var mycolor = {
					type: 'linear',
					x: 0,
					y: 0,
					x2: 0,
					y2: 1,
					colorStops: [{
						offset: 0,
						color: 'aqua' // 0% 处的颜色
					}, {
						offset: 1,
						color: 'rgba(10, 50, 128, 1)' // 100% 处的颜色
					}],
					global: false // 缺省为 false
				};
线的样式 lineStyle

lineStyle:{
width:12,
cap:“round”
opacity:0.7,
},

面的样式

areaStyle{
color:linear2,
}

数据的堆叠

stack:true

label标签

show:true 是否显示
格式化

formatter:"{
{a}{b}{c}
}"
a 代表数据名
b 系列名
c 数字

位置

position
insideRight 内部右侧
top/left/right/bottom/inside

颜色

color

多图表

网格布局

grid
top/left/right/bottom/
height
width

轴线指定

xAxis yAxis
gridIndex:0,gridIndex:1

数据指定轴线

xAxisIndex:0
yAxisIndex:0

echarts基本用法

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="js/echarts.min.js"></script>//引入echarts
		<script src="js/purple-passion.js"></script>//引入自定义主题
		<style>
			#container {
   
				width: 1000px;
				height: 600px;
			}
		</style>
	</head>
	<body>
		<div id="container">

		</div>
		<script>
			// 01 修改主题 dark light , 自定义
			// 02 修改调色盘
			// 初始化echart实例
			var echart = echarts.init(document.getElementById("container")
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值