# vue-iperf3-chart

> A Vue component to plot iperf3 json data

Latest version **1.1.1** (published 2019-11-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-iperf3-chart
pnpm add vue-iperf3-chart
yarn add vue-iperf3-chart
bun add vue-iperf3-chart
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2019-11-19 |
| First published | 2019-11-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 3.2 MB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | DCsunset |
| Maintainers | dcsunset |
| Keywords | vue, chart.js, iperf3 |

## Links

- npm: https://www.npmjs.com/package/vue-iperf3-chart
- Repository: https://github.com/DCsunset/vue-iperf3-chart
- Homepage: https://github.com/DCsunset/vue-iperf3-chart#readme
- Issues: https://github.com/DCsunset/vue-iperf3-chart/issues
- npm.io page: https://npm.io/package/vue-iperf3-chart

## Dependencies (5)

- [vue](https://npm.io/package/vue.md) ^2.6.10
- [core-js](https://npm.io/package/core-js.md) ^2.6.10
- [chart.js](https://npm.io/package/chart.js.md) ^2.9.3
- [chartjs-plugin-annotation](https://npm.io/package/chartjs-plugin-annotation.md) ^0.5.7
- [chartjs-plugin-colorschemes](https://npm.io/package/chartjs-plugin-colorschemes.md) ^0.4.0

## Alternatives

- [d3-force-3d](https://npm.io/package/d3-force-3d.md) — 1.0M weekly downloads
- [ng2-charts](https://npm.io/package/ng2-charts.md) — 486.8K weekly downloads
- [@arcgis/core](https://npm.io/package/@arcgis/core.md) — 257.8K weekly downloads
- [react-sparklines](https://npm.io/package/react-sparklines.md) — 249.3K weekly downloads
- [react-native-gifted-charts](https://npm.io/package/react-native-gifted-charts.md) — 182.3K weekly downloads

## Recent versions

- 1.1.1 (latest) — 2019-11-19
- 1.1.0 — 2019-11-19
- 1.0.2 — 2019-11-19
- 1.0.1 — 2019-11-19
- 1.0.0 — 2019-11-19
- 0.3.0 — 2019-11-19
- 0.2.0 — 2019-11-17
- 0.1.0 — 2019-11-17

## README

# vue-iperf3-chart

[![npm](https://img.shields.io/npm/v/vue-iperf3-chart.svg)](https://www.npmjs.com/package/vue-iperf3-chart)
[![npm](https://img.shields.io/npm/dm/vue-iperf3-chart.svg)](https://www.npmjs.com/package/vue-iperf3-chart)
[![GitHub](https://img.shields.io/github/license/DCsunset/vue-iperf3-chart.svg?color=blue)](https://github.com/DCsunset/vue-iperf3-chart/blob/master/LICENSE)

A Vue component to plot iperf3 json data.

## Install

```
npm install vue-iperf3-chart
```

## Usage

First import the package and **css**,
and then use it as a Vue Component:

```html
<template>
	<div style="height: 95vh">
		<chart
			:data="jsonData"
			:labels="labels"
			:options="options"
			:fillAlpha="0.3"
		/>
	</div>
</template>

<script>
import jsonData from "./data.json";
import Chart from "vue-iperf3-chart";
import "vue-iperf3-chart/dist/vue-iperf3-chart.css";

export default {
	name: "app",
	components: {
		Chart
	},
	data() {
		return {
			jsonData,
			labels: ["Label 1", "Label 2"],
			options: {
				maintainAspectRatio: false
			}
		};
	}
};
</script>
```

The iperf3 chart's height and width depend on its parent node.
When the size of its parent node changes,
it changes as well.

The chart's data is also responsive.
When the data changes,
the chart will be refreshed.

## Props

| Prop        | Type   | Default                     | Description                                                                                                                       |
| ----------- | ------ | --------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| data        | Array  | `undefined`                 | An array of iperf3 json data                                                                                                      |
| options     | Object | `undefined`                 | options passed to Chart.js                                                                                                        |
| unit        | String | `"Mbits"`                   | The unit can be `"Kbits"`, `"Mbits"` or `"Gbits"`                                                                                 |
| start       | Number | `0`                         | The starting interval in data                                                                                                     |
| end         | Number | `-1`                        | The ending interval in data (-1 means the end)                                                                                    |
| fillAlpha   | Number | `0.5`                       | The background alpha channel of each line                                                                                         |
| colorScheme | String | `"tableau.ClassicMedium10"` | The color scheme used in `chartjs-plugin-colorschemes`. It can be picked at <https://nagix.github.io/chartjs-plugin-colorschemes> |


## Events

| Event  | Argument    | Description                                  |
| ------ | ----------- | -------------------------------------------- |
| parsed | Parsed data | When data changes, the event will be emitted |



## Test

First clone this repository and install dependencies:

```
npm install
```

Then start the dev server to plot

```
npm run serve
```

Put the json data file in `src/data.json`.

Then change the options of Chart.js in `App.vue`
to have custom settings.


## Screenshot

![Screenshot](./Screenshot.png)

## License

MIT License

---
_Source: https://npm.io/package/vue-iperf3-chart · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
