Skip to content
Advertisement

Tag: vue-chartjs

How to add images to chart labels with vue-chartjs?

I want to add flag icons under the country code labels but am completely stuck. Image of the chart with my current code The images are named BR.svg, FR.svg and MX.svg and are located under @/assets/icons/flags/ I am using vue@2.6.12 and vue-chartjs@3.5.1 in my project. This is my Chart.vue component: This runnable code below is the closest to a solution

Image with dynamic data vuejs and chart.js

I have this code to show bar-chart with VueJS: Method in VueJS This code show this bar chart: But I need replace in my code two variables dynamic: labels: [‘MICROFINANZAS -SECTOR COMERCIO’,’MICROFINANZAS -SECTOR SERVICIOS’], data: [15000, 71700] With the information of method getDeudas() How can to made this action? Answer This is the solution, I use props and watch:

Advertisement