-
-
Notifications
You must be signed in to change notification settings - Fork 832
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
VueChart.js with inline plugins example #277
Comments
Well, I guess you have to install the plugin over npm Then import or require it import * as PriceLabel from 'chart.piecelabel.js'
// If the import is not working you could try to require it
const PriceLabel = require('chart.pricelabel.js') and then add it as a plugin
This would be the approch for a per chart basis. To register it globally for all charts (that are supported by that plugin) You have to import the chart instance fist. import Chart from 'chart.js'
Chart.plugins.register(PriceLabel) |
you are a marvellous person. |
I think this should be in the docs. And also how to pass configuration to the plugin |
@ebisbe not sure what you mean. https://vue-chartjs.org/#/home?id=inline-plugins And also the plugins prop if you want to pass it to your chart: |
Edit: @apertureless I'm trying to use annotation plugin but I'm not really being able to use it. So far I have a custom component that wraps LineChart with
But I'm not sure where or how I have to pass the Annotations configuration. |
I guess you are using this one? https://github.com/chartjs/chartjs-plugin-annotation Well, they say:
So have you tried this? const options = {
responsive: true,
title: {
display: true,
text: 'Put your other options in here'
}
annotation: {
events: ['click'],
annotations: []
}
}
this.renderChart(data, options) |
Yes, I figured it out. There's an issue with using array labels thanks, anyway |
Greetings, this is no longer available and is already on V5, how to add inline plugins now? would like to do this: plugins: [{
beforeInit: function(chart) {
chart.data.labels.forEach((e, i, a) => {
if (/\n/.test(e)) {
a[i] = e.split(/\n/);
}
});
}
}] |
@mreduar |
Hi guys, it might not be the place to ask this kind of question, but as a newbie, I don't really understand how to use plugins ...
I'd like to add this plugin PieceLabel to my component below.
The issue is how does it recognize the id ??
Thanks a lot
The text was updated successfully, but these errors were encountered: