Comments (7)
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.
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.
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.
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.
Thanks @HenriSup for the follow up!
from chartjs-plugin-datalabels.
@HenriSup did you progress on that integration?
from chartjs-plugin-datalabels.
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)
- datalabes plugin doesn't work with ES module HOT 1
- Type of font.size might be wrong on the options page.
- Feature Request: option to handle when label cannot fit inside a bar
- vite not insert page ref in manifest.json if I include chartjs-plugin-datalabels HOT 1
- When using with zoom plugin, `clip: true` affect the labels on the edge
- Chartjs .js and .cjs are both imported when using chartjs-plugin-datalabels
- FR: Images and/or Text
- Problem display datalables using Chart.js 4.4.0 HOT 2
- Not compatible with Chart.js 4.4.1 HOT 2
- Add boolean property to match the Datalabels color with the corresponding line/bar color
- Not working with Chart.js 4.4.1 (latest)
- Cant align plugins.legent.labels correctly
- Horizontal stacked barchart with negative values label position is off
- letterSpacing option is not working
- Line or arrow towards data point? HOT 1
- Crashes on Chart.js 4.4.1 and 4.4.0 HOT 3
- Update datalabels when chart is updated.
- know if a label is clipped?
- Display Error when using data labels and min and/or max values for the x-axis HOT 4
- Chart.js label position incorrect for horizontal stacked bar chart
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chartjs-plugin-datalabels.