Giter VIP home page Giter VIP logo

Comments (7)

HenriSup avatar HenriSup commented on May 18, 2024 44

Ok, sorry for the wait i finally managed to get some time to explain how i did it (it's actually pretty simple)
-Install chartJsPluginDataLabels via npm:

npm install chartjs-plugin-datalabels --save

-import it as a component in your vue:

import ChartJsPluginDataLabels from 'chartjs-plugin-datalabels';

var app = new Vue({
  el: '#app',
  data: {
    message: 'Hello Vue!'
  },
  components: {
    ChartJsPluginDataLabels,
  },
})

and there it is, you should have datalabels on your vue-chartjs :)
if you want to change any options on your charts it's just like the regular chartjs : https://chartjs-plugin-datalabels.netlify.com/options.html

from chartjs-plugin-datalabels.

simonbrunel avatar simonbrunel commented on May 18, 2024 4

Sounds great! It's a good idea to document more precisely the way you get it working, that could help other Vue.js users who want to use this plugin.

from chartjs-plugin-datalabels.

folmert avatar folmert commented on May 18, 2024 4

I've added it to components property of my single file component, but it got applied to all my components, how can I define a scope for this?
Edit: I've solved it #188

from chartjs-plugin-datalabels.

simonbrunel avatar simonbrunel commented on May 18, 2024 1

I'm not familiar with Vue.js or vue-chartjs, did that thread help?

You will probably need vue-chartjs 2.8.7 (since this plugin requires Chart.js 2.7) and thus Vue.js 2.4.4. Then I'm not sure what is the best way to import JavaScript libraries in Vue.js, maybe simply load it via a <script> tag (so no need of the node.js package) (example):

<!-- index.html -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>

It may be better to ask this question on the vue-chartjs project and link to that ticket.

from chartjs-plugin-datalabels.

simonbrunel avatar simonbrunel commented on May 18, 2024 1

Thanks @HenriSup for the follow up!

from chartjs-plugin-datalabels.

simonbrunel avatar simonbrunel commented on May 18, 2024

@HenriSup did you progress on that integration?

from chartjs-plugin-datalabels.

HenriSup avatar HenriSup commented on May 18, 2024

Yes sorry for the silence it was actually pretty simple just installed it via npm and imported it the way you import component in vue.js and it was on all my charts, just had to add some parameters via the data.plugin.etc.... but I'm not at work this week I'm only telling this by memory. Should I close the topic or would it be better if I add more precision and a clear way to explain how I did when I'll be back at my workplace?

from chartjs-plugin-datalabels.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.