Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add this plugin to Vue project? #124

Open
scorpioRED opened this issue Apr 15, 2020 · 2 comments
Open

How to add this plugin to Vue project? #124

scorpioRED opened this issue Apr 15, 2020 · 2 comments

Comments

@scorpioRED
Copy link

Hi!
I didn't find any instruction about how to add this plugin to Vue project if I already use chartjs

@sumant4ssm
Copy link

Hi!
I didn't find any instruction about how to add this plugin to Vue project if I already use chartjs

I too want to use this with Vue js but it doesn't seem to be working, may we are not properly configuring it?

@almunnings
Copy link

almunnings commented May 6, 2021

Using vue-chartjs it works with the following example:

import { Doughnut } from 'vue-chartjs';
import ChartPluginLabels from 'chartjs-plugin-labels';

export default {
  name: 'ChartDoughnut',

  extends: Doughnut,

  props: {
    chartData: {
      type: Object,
      default: () => {},
    },
    options: {
      type: Object,
      default: () => {},
    },
    plugins: {
      type: Array,
      default: () => [ChartPluginLabels],
    },
  },

  mounted() {
    this.renderChart(this.chartData, this.options);
  },
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants