All Projects → dmtrbrl → Vue Trend Chart

dmtrbrl / Vue Trend Chart

Licence: mit
Simple trend charts for Vue.js

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Vue Trend Chart

vue-g2
基于 Vue 和 AntV/G2 的可视化组件库 📈
Stars: ✭ 73 (-66.2%)
Mutual labels:  chart, vue-component
Vue Tree Chart
A vue2 component to display tree chart
Stars: ✭ 351 (+62.5%)
Mutual labels:  chart, vue-component
Vue Echarts V3
Vue.js(v2.x+) component wrap for ECharts.js(v3.x+)
Stars: ✭ 884 (+309.26%)
Mutual labels:  chart, vue-component
Plotjuggler
The Time Series Visualization Tool that you deserve.
Stars: ✭ 2,620 (+1112.96%)
Mutual labels:  chart
Tui.editor
🍞📝 Markdown WYSIWYG Editor. GFM Standard + Chart & UML Extensible.
Stars: ✭ 14,016 (+6388.89%)
Mutual labels:  chart
Wxapp Charts
🏹微信小程序图表charts组件
Stars: ✭ 201 (-6.94%)
Mutual labels:  chart
Vue Morris
VueJS component wrapping Morris.js
Stars: ✭ 212 (-1.85%)
Mutual labels:  chart
Smoothie
Smoothie Charts: smooooooth JavaScript charts for realtime streaming data
Stars: ✭ 2,145 (+893.06%)
Mutual labels:  chart
Meter
Laravel package to find performance bottlenecks in your laravel application.
Stars: ✭ 204 (-5.56%)
Mutual labels:  chart
Swiftcharts
Easy to use and highly customizable charts library for iOS
Stars: ✭ 2,336 (+981.48%)
Mutual labels:  chart
Tkradarchart
A customizable radar chart in Swift
Stars: ✭ 199 (-7.87%)
Mutual labels:  chart
Visx
🐯 visx | visualization components
Stars: ✭ 14,544 (+6633.33%)
Mutual labels:  chart
Helm Gcs
Manage Helm 3 repositories on Google Cloud Storage 🔐 **privately**
Stars: ✭ 202 (-6.48%)
Mutual labels:  chart
Orgchart
It's a simple and direct organization chart plugin. Anytime you want a tree-like chart, you can turn to OrgChart.
Stars: ✭ 2,325 (+976.39%)
Mutual labels:  chart
Vue Org Chart
Manage and publish your interactive organization chart (orgchart), 100% free and no install required: just copy a folder to any location
Stars: ✭ 207 (-4.17%)
Mutual labels:  chart
Vue Orgchart
It's a simple and direct organization chart plugin. Anytime you want a tree-like chart, you can turn to OrgChart.
Stars: ✭ 182 (-15.74%)
Mutual labels:  chart
Squid
A Ruby library to plot charts in PDF files
Stars: ✭ 205 (-5.09%)
Mutual labels:  chart
Jira Dependency Graph
Graph visualizer for JIRA tickets' dependencies
Stars: ✭ 194 (-10.19%)
Mutual labels:  chart
Charts
⚡ Laravel Charts — Build charts using laravel. The laravel adapter for Chartisan.
Stars: ✭ 2,337 (+981.94%)
Mutual labels:  chart
Sprite
🖌 Draw charts in code. Render in real-time. Embed anywhere as .png.
Stars: ✭ 201 (-6.94%)
Mutual labels:  chart
Vue Trend

💿 Installation

npm i vue-trend-chart

🚀 Usage

import Vue from "vue";
import TrendChart from "vue-trend-chart";

Vue.use(TrendChart);

Example:

<TrendChart
  :datasets="[
    {
      data: [10, 50, 20, 100, 40, 60, 80],
      smooth: true,
      fill: true
    }
  ]"
  :grid="{
     verticalLines: true,
     horizontalLines: true
  }"
  :labels="{
     xLabels: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
     yLabels: 5
  }"
  :min="0">
</TrendChart>

🔧 Props

datasets

Required
Type: Array

Array of objects with properties for each dataset.

grid

Type: Object

Grid properties

labels

Type: Object

Labels properties

min

Type: Number
Default: min value from datasets

max

Type: Number
Default: max value from datasets

padding

Type: String
Default: "5"

If you set a large stroke-width on your lines, you may notice that it gets "cropped" towards the edges. It's similar to "padding" CSS property but without specifying units.

Examples:
"5" apply to all four sides
"5 10" vertical | horizontal
"5 15 10" top | horizontal | bottom
"5 10 15 20" top | right | bottom | left

interactive

Type: Boolean
Default: false

Allows to set onmousemove interaction. Set to true to enable.

⚡️ Events

mouse-move

Callback function for onmouseover interaction.
Receives an object {index: Number, data: Array} parameter based on current active line.
This function has no effect if interactive isn't set to true.

📈 Dataset Props

Chart line (curve) properties

data

Type: Number|Object

Example: [70, 100, 400, 180, 100] or [{ value: 70 }, { value: 100 }, { value: 400 }, { value: 180 }, { value: 100 }]
For object type you can also add other properties to use them in interactive mode.

className

Type: String

Allows to append custom class to chart line for future styling.

smooth

Type: Boolean
Default: false

Allows the peaks to be 'rounded' out.

stroke

Type: Boolean
Default: true

If false, the line is not drawn for this dataset.

fill

Type: Boolean
Default: false

Allows to fill the area under the line. Set to true to enable.

showPoints

Type: Boolean
Default: false

Allows to show points. Set to true to enable.

#️⃣ Grid Props

verticalLines

Type: Boolean
Default: false

Allows to show vertical gridlines. Set to true to enable.

verticalLinesNumber

Type: Number
Default: number of xLabels

Allows to set custom number of vertical gridlines.
This prop has no effect if verticalLines isn't set to true.

horizontalLines

Type: Boolean
Default: false

Allows to show horizontal gridlines. Set to true to enable.

horizontalLinesNumber

Type: Number
Default: number of yLabels

Allows to set custom number of horizontal gridlines.
This prop has no effect if horizontalLines isn't set to true.

🔤 Labels Props

xLabels

Type: Array

X axis labels.
Example: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]

yLabels

Type: Number

Number of Y axis labels. Labels text is based on data values.

yLabelsTextFormatter

Type: Function

Allows to format Y axis labels text.
Example: val => "$" + Math.round(val * 100) / 100.
This function has no effect if yLabels prop has no value.

🎨 Styling

Just use CSS to style your charts.

Here is an example of a tree structure with available class names:

<svg class="vtc">
  <g class="grid">
    <g class="vertical">
      <line class="line"></line>
      ...
    </g>
    <g class="horizontal">
      <line class="line"></line>
      ...
    </g>
  </g>

  <g class="labels">
    <g class="x-labels">
      <g class="label">
        <text></text>
      </g>
      ...
    </g>
    <g class="y-labels">
      <g class="label">
        <text></text>
      </g>
      ...
    </g>
  </g>

  <g class="curve">
    <path class="fill"></path>
    <path class="stroke"></path>
    <g class="points">
      <circle class="point"></circle>
      ...
    </g>
  </g>
  ...

  <line class="active-line"></line>
</svg>

🔨 Development

npm install
npm run dev

💕 Contributing

Pull requests are welcome!

🔒 License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].