# ECharts Liquid Fill Chart
Liquid Fill Chart plugin for [ECharts](https://github.com/ecomfe/echarts), which is usually used to represent data in percentage.
![Rendering Results](http://g.recordit.co/zHeMqqlh4j.gif)
## Install ECharts
To use ECharts plugins, you need to include the plugin JavaScript file after ECharts file.
```html
<script src='echarts.js'></script>
<script src='echarts-liquidfill.js'></script>
```
ECharts can be downloaded at [GitHub dist directory](https://github.com/ecomfe/echarts/tree/master/dist) or [Download page of Official Website](http://echarts.baidu.com/download.html) (in Chinese).
>#### NOTE
>
> The minimum package of ECharts required by LiquidFill Chart is [simple version](https://github.com/ecomfe/echarts/blob/master/dist/echarts.simple.js) on GitHub, or selecting nothing in [online builder](http://echarts.baidu.com/builder.html) (in Chinese). If you need other chart types or components in your other chart, you should include them accordingly.
## Install echarts-liquidfill with npm
```sh
npm install echarts-liquidfill
```
npm will warn you that you have to install peer dependencies by yourself:
```
npm WARN echarts-liquidfill@2.0.4 requires a peer of echarts@^4.2.1 but none is installed. You must install peer dependencies yourself.
npm WARN echarts-liquidfill@2.0.4 requires a peer of zrender@^4.0.7 but none is installed. You must install peer dependencies yourself.
```
Note that the version number may change in your case. Install will the version it shows.
```
npm i echarts@^4.2.1 zrender@^4.0.7
```
## Download echarts-liquidfill from GitHub
You may download the lastest ECharts files on [ECharts official site](http://echarts.baidu.com/download.html) and download this plugin in [dist directory](https://github.com/ecomfe/echarts-liquidfill/tree/master/dist). Note that if you need tooltip for Liquid Fill Chart, you need the complete ECharts version. Otherwise, simple version will do.
## Notes
### Omitted `normal`
Since [ECharts v4.0.0]((https://github.com/ecomfe/echarts/releases/tag/4.0.0)), `normal` is no longer needed for `itemStyle` or `label`.
### Flatten `textStyle`
Since [ECharts v3.7.0](https://github.com/ecomfe/echarts/releases/tag/3.7.0), `textStyle` option is flatten, so that `series.label[normal|emphasis].textStyle.xxx` is now can be written in `series.label[normal|emphasis].textStyle`. This is supported from [echarts-liquidfill](https://github.com/ecomfe/echarts-liquidfill/releases/tag/v1.0.6) v1.0.6. So if you found examples with `textStyle` in old demo, don't be too surprised.
## Quick Start
- [API](https://github.com/ecomfe/echarts-liquidfill#api)
- [Examples at ECharts Gallery](http://gallery.echartsjs.com/explore.html#tags=liquidFill~sort=rank~timeframe=all~author=all)
Here are some common uses:
- [Use multiple waves in a chart](https://github.com/ecomfe/echarts-liquidfill#multiple-waves)
- [Change waves color and opacity](https://github.com/ecomfe/echarts-liquidfill#color-and-opacity)
- [Make waves static](https://github.com/ecomfe/echarts-liquidfill#static-waves)
- [Water with no waves](https://github.com/ecomfe/echarts-liquidfill#still-water)
- [Set attributes for a single wave](https://github.com/ecomfe/echarts-liquidfill#change-a-single-wave)
- [Change background and border style](https://github.com/ecomfe/echarts-liquidfill#background-style)
- [Hide outline in chart](https://github.com/ecomfe/echarts-liquidfill#outline-style)
- [Change shape with SVG](https://github.com/ecomfe/echarts-liquidfill#shape)
- [Setup animation](https://github.com/ecomfe/echarts-liquidfill#animation)
- [Change text content and style](https://github.com/ecomfe/echarts-liquidfill#change-text)
- [Change shadow style](https://github.com/ecomfe/echarts-liquidfill#shadow)
- [Setup tooltip](https://github.com/ecomfe/echarts-liquidfill#tooltip)
- [Click event](https://github.com/ecomfe/echarts-liquidfill#click-event)
- [Make an element non-interactable](https://github.com/ecomfe/echarts-liquidfill#non-interactable)
To ask a question, you may fork [Liquid Fill Chart Example on Gallery](http://gallery.echartsjs.com/editor.html?c=xr1XplzB4e) and copy your code there. Then you may [open an issue](https://github.com/ecomfe/echarts-liquidfill/issues/new) in this project.
## Examples
### A Simple Example
To create a Liquid Fill Chart, you need to have a series with type of `'liquidFill'`. A basic option may be:
```js
var option = {
series: [{
type: 'liquidFill',
data: [0.6]
}]
};
```
![A simple liquid fill chart](http://g.recordit.co/RsjUlo69JN.gif)
[Run](http://gallery.echartsjs.com/editor.html?c=xr1XplzB4e)
### Multiple Waves
It is easy to create a liquid fill chart will multiple waves, either to represent multiple data, or to improve the visual effect of the chart.
```js
var option = {
series: [{
type: 'liquidFill',
data: [0.6, 0.5, 0.4, 0.3]
}]
};
```
This creates a chart wit waves at position of 60%, 50%, 40%, and 30%.
![Multiple waves](http://g.recordit.co/HJ3z3ITqzL.gif)
[Run](http://gallery.echartsjs.com/editor.html?c=xSyIEWMBNl)
### Color and Opacity
To set colors for liquid fill chart series, set `color` to be an array of colors. To set opacity, use `itemStyle.opacity` and `itemStyle.emphasis.opacity` for normal style and hover style.
```js
var option = {
series: [{
type: 'liquidFill',
data: [0.5, 0.4, 0.3],
color: ['red', '#0f0', 'rgb(0, 0, 255)'],
itemStyle: {
opacity: 0.6
},
emphasis: {
itemStyle: {
opacity: 0.9
}
}
}]
};
```
![Color and opacity](http://g.recordit.co/ZVRBdxO6oY.gif)
[Run](http://gallery.echartsjs.com/editor.html?c=xrJpDC704l)
You may also set the color and opacity of a single data item by:
```js
var option = {
series: [{
type: 'liquidFill',
data: [0.5, 0.4, {
value: 0.3,
itemStyle: {
color: 'red',
opacity: 0.6
},
emphasis: {
itemStyle: {
opacity: 0.9
}
}
}]
}]
};
```
![Color and opacity of a single data item](http://g.recordit.co/Smz5G8ypvO.gif)
[Run](http://gallery.echartsjs.com/editor.html?c=xBJPCRXR4l)
### Static Waves
To provent the waves from moving left or right, you may simply set `waveAnimation` to be `false`. To disable the animation of waves raising, set `animationDuration` and `animationDurationUpdate` to be 0.
```js
var option = {
series: [{
type: 'liquidFill',
waveAnimation: false,
animationDuration: 0,
animationDurationUpdate: 0,
data: [0.6, 0.5, 0.4, 0.3]
}]
};
```
![Static waves](http://g.recordit.co/Wze7eblLPM.gif)
[Run](http://gallery.echartsjs.com/editor.html?c=xH1VfVVREx)
### Still Water
You may set the `amplitude` to be 0 to make still waves.
```js
var option = {
series: [{
type: 'liquidFill',
data: [0.6, 0.5, 0.4, 0.3],
amplitude: 0,
waveAnimation: 0
}]
};
```
It is recommended to set `waveAnimation` to be false in this case to disable animation for performance consideration.
![Still water](http://g.recordit.co/EQ5pnYDAtN.gif)
[Run](http://gallery.echartsjs.com/editor.html?c=xHy1NHVCNx)
### Change A Single Wave
To change a single wave, overwrite the options in data item.
```js
var option = {
series: [{
type: 'liquidFill',
data: [0.6, {
value: 0.5,
direction: 'left',
itemStyle: {
color: 'red'
}
}, 0.4, 0.3]
}]
};
```
![Change a single wave](http://g.recordit.co/31VHgsRV2
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
大数据可视化大屏前端源码大数据可视化大屏前端源码大数据可视化大屏前端源码大数据可视化大屏前端源码大数据可视化大屏前端源码大数据可视化大屏前端源码大数据可视化大屏前端源码大数据可视化大屏前端源大数据可视化大屏前端源码码大数据可视化大屏前端源码大数据可视化大屏前端源码大数据可视化大屏前端源码大数据可视化大屏前端源码大数据可视化大屏前端源码大数据可视化大屏前端源码大数据可视化大屏前端源码
资源推荐
资源详情
资源评论
收起资源包目录
【数据可视化】智慧销售 可视化大屏前端源码.zip (164个子文件)
bootstrap.css 141KB
easyui.css 71KB
style.css 66KB
jquery-ui.css 35KB
style.css 30KB
swiper.min.css 19KB
style.css 14KB
office_efficiency_index.css 11KB
index.css 10KB
main_design1.css 4KB
room.css 4KB
icomoon.css 1KB
icomoon.eot 4KB
index1.gif 1.35MB
index.gif 622KB
index.html 21KB
index.html 19KB
index.html 12KB
index.html 10KB
Demo.html 9KB
index.html 8KB
fill-container.html 3KB
test.html 2KB
war_room_main.jpg 247KB
screenbg_design1.jpg 244KB
前后端技术资料库.jpg 81KB
echarts.js 2.81MB
echarts.js 2.37MB
echarts-liquidfill.js 1.2MB
echarts.min.js 730KB
echarts.min.js 727KB
echarts.min.js 691KB
echarts-wordcloud.js 430KB
jquery.easyui.min.js 395KB
jquery.js 284KB
jquery.min.js 176KB
swiper.min.js 123KB
echarts-liquidfill.min.js 122KB
jquery-1.11.0.min.js 94KB
jquery.min.js 94KB
jquery.1.11.3.min.js 94KB
jquery.min.js 86KB
bootstrap.js 66KB
china.js 61KB
china.js 60KB
office_efficiency_index.js 35KB
room.js 29KB
big_design1.js 20KB
main.js 19KB
main.js 17KB
index.js 15KB
mymap.js 11KB
office_efficiency_data.js 9KB
respond.js 9KB
liquidFillLayout.js 5KB
geoCoord.js 4KB
liquidFillSeries.js 2KB
liquidFill.js 239B
index.js 47B
package.json 2KB
package-lock.json 322B
style.less 78KB
style.less 42KB
echarts-liquidfill.min.js.map 1.09MB
README.md 22KB
license.md 1KB
sezhi.png 1.74MB
53bg.png 1.4MB
background.png 917KB
office_efficiency_foot_bg.png 654KB
office_efficiency_header_bg.png 601KB
53earth.png 154KB
circle.png 139KB
no-data.png 105KB
bg.png 64KB
cicle.png 52KB
di.png 45KB
53centercircle.png 42KB
53cloud.png 37KB
53gqright.png 35KB
53gqleft.png 34KB
53bottomsjbg.png 29KB
content_down.png 28KB
content_down1.png 28KB
content_comm.png 27KB
content_comm1.png 27KB
53titlebg.png 24KB
border.png 23KB
border02.png 22KB
logo.png 21KB
535gqbottomright.png 19KB
53gqbottomleft.png 18KB
2222.png 13KB
huan.png 13KB
cpu_use.png 11KB
nei_cun_use.png 11KB
leftBorder.png 11KB
rightBorder.png 11KB
nei_cun_size.png 10KB
图层 27 拷贝.png 10KB
共 164 条
- 1
- 2
资源评论
柯晓楠
- 粉丝: 2w+
- 资源: 2847
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 使用 HTML 和 CSS 实现绚丽的节日烟花效果
- html/css/javascript实现简单的圣诞快乐demo
- 全志V3s GPIO驱动示例(传统设备驱动模型、平台总线设备驱动模型、设备树驱动模型)
- 基于pytho的turtle库实现的圣诞快乐demo
- 【深度学习系列专栏】ch01配套资源
- yolov4 - tiny 900张图片训练效果3
- 连接服务器的服务,可以电脑直连后获得服务器信息
- Vue.js 2.0 入门Demo文档步骤梳理
- 用JavaScript实现文字上下浮动效果
- 用python的turtle库实现新年快乐demo
- Parallels Desktop Activation Tool
- 用java是swing库实现新年快乐动效demo
- mingw资源包wenjian
- 华为汽车产品知识 外呼邀约需要注意什么
- LABVIEW程序实例-cp2_ex10.zip
- LABVIEW程序实例-chart接受的数据类型.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功