当前位置: 首页 > news >正文

【vue】简洁优雅的火花线、趋势线

来由

在github发现个好看易用的vue趋势线组件,特此记录。

效果

趋势图生成后效果如上,线条为渐变色,可设置是否平滑。具体线条走势,根据数据动态生成。 

使用

安装

npm i vuetrend -S

引入

import Vue from "vue"
import Trend from "vuetrend"Vue.use(Trend)

使用

<trend:data="[0, 2, 5, 9, 5, 10, 3, 5, 0, 0, 1, 8, 2, 9, 0]":gradient="['#6fa8dc', '#42b983', '#2c3e50']"auto-drawsmooth
>
</trend>

其他可配置项

NameTypeDefaultDescriptionExample
dataNumber|ObjectundefinedThe 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 }]
gradientString['#000']Colour can be specified as any SVG-supported format (named, rgb, hex, etc).['#0FF', '#F0F', '#FF0']
gradientDirectionStringtopTop, Bottom, Left or Right.
widthNumberautoSet an explicit width for your SVG.-
heightNumberautoSet an explicit height for your SVG.-
paddingNumber8If you set a very large strokeWidth on your line, you may notice that it gets "cropped" towards the edges.-
smoothBooleanfalseSmooth allows the peaks to be 'rounded' out so that the line has no jagged edges.-
radiusNumber10When 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.-
autoDrawBooleanfalseAllow the line to draw itself on mount. Set to true to enable, and customize using autoDrawDuration and autoDrawEasing.-
autoDrawDurationNumber2000The amount of time, in milliseconds, that the autoDraw animation should span. This prop has no effect if autoDraw isn't set to true.-
autoDrawEasingStringeaseThe easing function to use for the autoDraw animation. Accepts any transition timing function within the CSS spec (eg. lineareaseease-incubic-bezier...).-
maxNumber-InfinitySpecify max value-
minNumberInfinitySpecify min value, This is useful if you have multiple lines. See #8-

组件来自于:GitHub - QingWei-Li/vue-trend: 🌈 Simple, elegant spark lines for Vue.js 

http://www.lryc.cn/news/126256.html

相关文章:

  • 【软件工程】数据流图/DFD概念符号/流程图分层/数据字典
  • 时序预测 | MATLAB实现基于CNN卷积神经网络的时间序列预测-递归预测未来(多指标评价)
  • Python中的字符串与字符编码
  • 图数据库_Neo4j学习cypher语言_使用CQL命令002_删除节点_删除属性_结果排序Order By---Neo4j图数据库工作笔记0006
  • C语言学习笔记---数据的存储详解
  • js中的常见事件(鼠标事件,键盘事件,表单事件......)
  • 学校如何公布录取情况?源代码公布了
  • JAVA基础知识(一)——Java语言描述、变量和运算符
  • 时序预测 | MATLAB实现基于KNN K近邻的时间序列预测-递归预测未来(多指标评价)
  • 冉冉升起的星火,再度升级迎来2.0时代!
  • centos7安装erlang及rabbitMQ
  • 项目介绍:《WeTalk》网页聊天室 — Spring Boot、MyBatis、MySQL和WebSocket的奇妙融合
  • (el-Table)操作(不使用 ts):Element-plus 中Table 表格组件:多选修改成支持单选及表格相关样式的调整
  • 【JAVA】变量的作用域与生存周期
  • 中科亿海微FIFO使用
  • 使用maven打包时如何跳过test,有三种方式
  • 005-Spring 扩展点 :PostProcess
  • MFC中的窗体绘制事件函数:OnCtlColor、OnPaint、OnNcPaint、OnDrawItem、OnEraseBkgnd、OnDraw
  • dialogbot:开箱即用的对话机器人解决方案,涵盖问答型对话、任务型对话和聊天型对话等多种场景,为您提供全方位的对话交互体验。
  • TCP服务器—实现数据通信
  • 基于SpringBoot实现MySQL备份与还原
  • 【VUE 监听用户滑动】
  • 通义大模型:打造更智能、更灵活的自然语言处理技术
  • Go 流程控制
  • Python opennsfw/opennsfw2 图片/视频 鉴黄 笔记
  • 四、Linux中cd、pwd以及相对/绝对路径和特殊路径符
  • 第八章 CUDA内存应用与性能优化篇(上篇)
  • chrome浏览器改为黑色背景
  • 【AI】《动手学-深度学习-PyTorch版》笔记(十七):卷积神经网络入门
  • element-ui table表格,根据缩放自适应