Socket
Book a DemoInstallSign in
Socket

github.com/seregpie/vuechart

Package Overview
Dependencies
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/seregpie/vuechart

Source
Go
Version
v0.0.0-20210524173630-01970e7034a4
Version published
Created
Source

VueChart

A simple wrapper for Chart.js.

Works for Vue 2 & 3.

dependencies

  • VueDemi

setup

npm

npm i @seregpie/vue-chart
import VueChart from '@seregpie/vue-chart';

browser

<!-- if using Vue 2 -->
<script src="https://unpkg.com/vue@2"></script>
<script src="https://unpkg.com/@vue/composition-api"></script>

<!-- if using Vue 3 -->
<script src="https://unpkg.com/vue@3"></script>

<script src="https://unpkg.com/vue-demi"></script>
<script src="https://unpkg.com/chart.js@3"></script>
<script src="https://unpkg.com/@seregpie/vue-chart"></script>

The module is globally available as VueChart.

usage

Register the component globally.

import {createApp} from 'vue';
import VueChart from '@seregpie/vue-chart';

let app = createApp({/*...*/});
app.component(VueChart.name, VueChart);
app.mount('body');

or

Register the component locally.

import VueChart from '@seregpie/vue-chart';

export default {
  components: {
    VueChart,
  },
  // ...
};
<vue-chart
  :data="chartData"
  :options="{scales: {y: {beginAtZero: true}}}"
  style="width: 800px; height: 600px;"
  type="bar"
/>

properties

nametypedescription
dataObjectThe data of the chart.
optionsObjectThe configuration options of the chart of the current type.
typeStringThe type of the chart. Changing the value will recreate the chart.
updateModeStringThe mode for the update process.

FAQs

Package last updated on 24 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts