-
-
Notifications
You must be signed in to change notification settings - Fork 829
ChartJS instance always returns null #1054
Unanswered
JoaoHCopetti
asked this question in
Q&A
-
I just can't get the chart instance in Vue ChartJS, it always returns null.
- Vue: 2.7
- Vue ChartJS: 5.2.0
- ChartJS: 4.3.3
import { Line as LineChart } from 'vue-chartjs' import { Chart as ChartJS, Tooltip, CategoryScale, LinearScale, PointElement, LineElement, Legend } from 'chart.js' import zoomPlugin from 'chartjs-plugin-zoom' ChartJS.register(CategoryScale, Legend, Tooltip, LinearScale, PointElement, LineElement, zoomPlugin) <script> export default { components: { LineChart }, methods: { test () { this.$refs.lineChart.chart // null this.$refs.lineChart.chartInstance // null too } } } </script> <template> <LineChart id="my-chart-id" ref="lineChart" /> </template>
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment
-
was an answer ever found for this?
Beta Was this translation helpful? Give feedback.
All reactions
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment