<p align=center>ð¥ð¥ð¥</p>
<p align=center>More powerful, more flexible chart library for Vue.js ð https://github.com/QingWei-Li/laue</p>
<p align=center>ð¥ð¥ð¥</p>
---
<div align="center">
<img src="https://cloud.githubusercontent.com/assets/7565692/23977197/9da0b77c-0a27-11e7-8f14-4d3845a524a0.png" width="500" alt="Vue Trend">
<br>
<h1>Vue Trend</h1>
<p>ð Simple, elegant spark lines for Vue.js</p>
<br>
<a href="https://www.npmjs.org/package/vuetrend"><img src="https://img.shields.io/npm/v/vuetrend.svg?style=flat-square" alt="npm"></a>
<!-- <a href="https://travis-ci.org/qingwei-li/vue-trend"><img src="https://img.shields.io/travis/qingwei-li/vue-trend/master.svg?style=flat-square" alt="travis"></a> -->
<img src="https://img.shields.io/badge/vue-^2.2-4fc08d.svg?colorA=2c3e50&style=flat-square" alt="vue">
<!-- <a href="https://codecov.io/github/qingwei-li/vue-trend"><img src="https://img.shields.io/codecov/c/github/qingwei-li/vue-trend.svg" alt="travis"></a> -->
</div>
## Installation
```shell
npm i vuetrend -S
```
## Usage
```js
import Vue from "vue"
import Trend from "vuetrend"
Vue.use(Trend)
```
_vue template_
```html
<trend
:data="[0, 2, 5, 9, 5, 10, 3, 5, 0, 0, 1, 8, 2, 9, 0]"
:gradient="['#6fa8dc', '#42b983', '#2c3e50']"
auto-draw
smooth
>
</trend>
```
[Live Demo](https://jsfiddle.net/nyh18bLq/)
## Inspired
[unsplash/react-trend](https://github.com/unsplash/react-trend) - ð Simple, elegant spark lines
## Props
| Name | Type | Default | Description | Example |
| ----------------- | -------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
| data | Number\|Object | `undefined` | The data accepted by Vue Trend is incredibly simple: An array of y-axis values to graph. | `[120, 149, 193.4, 200, 92]` or `[{ value: 4 }, { value: 6 }, { value: 8 }]` |
| gradient | String | `['#000']` | Colour can be specified as any SVG-supported format (named, rgb, hex, etc). | `['#0FF', '#F0F', '#FF0']` | - |
| gradientDirection | String | `top` | Top, Bottom, Left or Right. | | - |
| width | Number | auto | Set an explicit width for your SVG. | - |
| height | Number | auto | Set an explicit height for your SVG. | - |
| padding | Number | `8` | If you set a very large `strokeWidth` on your line, you may notice that it gets "cropped" towards the edges. | - |
| smooth | Boolean | `false` | Smooth allows the peaks to be 'rounded' out so that the line has no jagged edges. | - |
| radius | Number | `10` | When using **smoothing**, you may wish to control the amount of curve around each point. This prop has no effect if `smooth` isn't set to `true`. | - |
| autoDraw | Boolean | `false` | Allow the line to draw itself on mount. Set to `true` to enable, and customize using `autoDrawDuration` and `autoDrawEasing`. | - |
| autoDrawDuration | Number | `2000` | The amount of time, in milliseconds, that the autoDraw animation should span. This prop has no effect if `autoDraw` isn't set to `true`. | - |
| autoDrawEasing | String | `ease` | The easing function to use for the autoDraw animation. Accepts any transition timing function within [the CSS spec](http://www.w3schools.com/cssref/css3_pr_transition-timing-function.asp) (eg. `linear`, `ease`, `ease-in`, `cubic-bezier`...). | - |
| max | Number | `-Infinity` | Specify max value | - |
| min | Number | `Infinity` | Specify min value, This is useful if you have multiple lines. See [#8](https://github.com/QingWei-Li/vue-trend/issues/8) | - |
#### SVG Props
By default, all properties not recognized by Vue Trend will be delegated to the SVG. The line inherits these properties if none of its own override them.
This means that, among other properties, you can use:
- `stroke` to set a solid colour,
- `strokeWidth` to change the default line thickness,
- `strokeOpacity` to create a transparent line,
- `strokeLinecap`/`strokeLinejoin` to control the edges of your line,
- `strokeDasharray` to create a dashed line, and
- `strokeDashoffset` to control where the dashes start.
## Development
```sh
yarn
yarn dev
# open localhost:4000
```
## TODO
- Unit test
## License
MIT
没有合适的资源?快使用搜索试试~ 我知道了~
简单、优雅的 Vue.js 火花线.zip
共20个文件
js:9个
txt:2个
json:2个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 30 浏览量
2024-12-02
04:07:09
上传
评论
收藏 317KB ZIP 举报
温馨提示
更强大、更灵活的 Vue.js 图表库 https://github.com/QingWei-Li/laueVue 趋势 简单、优雅的 Vue.js 火花线 安装npm i vuetrend -S用法import Vue from "vue"import Trend from "vuetrend"Vue.use(Trend)vue 模板<trend :data="[0, 2, 5, 9, 5, 10, 3, 5, 0, 0, 1, 8, 2, 9, 0]" :gradient="['#6fa8dc', '#42b983', '#2c3e50']" auto-draw smooth></trend>现场演示受到启发unsplash/react-trend - 简洁优雅的火花线道具姓名 类型 默认 描述 例子数据 数字|对象 undefined Vue Trend 接受的数据非常简单要绘制图表的 y 轴值数组。 [120, 149, 193.4, 200, 92]或者[{ value: 4 }, {
资源推荐
资源详情
资源评论
收起资源包目录
简单、优雅的 Vue.js 火花线.zip (20个子文件)
.eslintrc 22B
yarn.lock 208KB
media
logo.png 195KB
标签.txt 36B
src
helpers
path.js 2KB
math.js 727B
components
gradient.js 878B
path.js 427B
trend.js 2KB
index.js 210B
LICENSE 1KB
docs
app.js 113B
home.vue 8KB
package.json 1KB
rollup.config.js 310B
package-lock.json 424KB
资源内容.txt 708B
.gitignore 52B
README.md 8KB
vbuild.config.js 112B
共 20 条
- 1
资源评论
徐浪老师
- 粉丝: 8234
- 资源: 9590
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 技术资料分享OV7670很好的技术资料.zip
- 技术资料分享OV7670 software application note很好的技术资料.zip
- 技术资料分享nRF24L01中文说明书很好的技术资料.zip
- 技术资料分享NRF24l01模块说明书很好的技术资料.zip
- 技术资料分享NRF24L01功能使用文档很好的技术资料.zip
- 技术资料分享nRF24L01P(新版无线模块控制IC)很好的技术资料.zip
- 技术资料分享Nintendo Entertainment System Documentation Version 1.0很好的技术资料.zip
- 技术资料分享NES Specifications很好的技术资料.zip
- 技术资料分享MultiMediaCard Product Manual很好的技术资料.zip
- 技术资料分享MP2359很好的技术资料.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功