-
-
Notifications
You must be signed in to change notification settings - Fork 836
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
Adding annotation plugin functionality #86
Comments
Well, So if you're experienced with Chart.js and Vue I don't know if you would benefit much from it. Because you can create and implement the charts by your own. However, I don't worked with Chart.js plugins, but have you tried just... to use them? :D As far as I can see, you can install the You have access to all you need In your Chart component where you <script>
import { Line } from 'vue-chartjs'
export default Line.extend({
props: ['options', 'chartData'],
mounted () {
this.renderChart(this.chartData, {
scales: {
xAxes: [{
type: 'linear',
position: 'bottom'
}]
}
})
console.log(this._chart) // Instace created with new Chart({})
console.log(Chart) // Chart.js global Object: import Chart from 'Chart.js'
}
})
</script> |
Close due to inactivity |
I just want to confirm you can just import the annotation plugin and it works. The below code doesn't have any issues.
|
@nbsynch that worked :D |
in case you need to get past your linter:
|
I've been going crazy reading all the issues in the annotation repo - when all along I simply wasn't importing the plugin in my chart component 🤦♂️ thanks @nbsynch !! |
There is actually no need to disable the linter for that line. It's complaining about an unused variable, so the following will work just fine:
Since you're not declaring any variables here, the linter won't complain. 😉 |
I think you could simply remove the |
|
Hello,
I'm working on a project that displays a line chart on one of its pages. I've implemented the whole thing using chart.js and one of its plugins chartjs-plugin-annotation.js. Now I want to make the same functionality using vue.js and vue-chartjs but I cannot find anything about how to add the plugin's functionality.
Is there an easy way to include this on my end or do you think you will offer some kind of support for plugins in the near future?
Thank you!
The text was updated successfully, but these errors were encountered: