Yopadd / vue-chartist

Pluging chartist for vuejs
Do What The F*ck You Want To Public License
172 stars 21 forks source link

How to use icons as labels in vue-chartist? #42

Open stiofanoriain opened 5 years ago

stiofanoriain commented 5 years ago

It's possible to get this to work in regular chartist. You add something like this:

    .on('draw', function(data) {
        if (data.type === 'label' && data.axis.units.pos === 'y') {
            var group = new Chartist.Svg('g');
            group.append(
                new Chartist.Svg('image', {
                        'xlink:href': data.text.image,
                        y: data.y,
                        width: '23px',
                        height:data.height
                    })
            );
            data.element.replace(group);
        }
    });

But how to get this to work with vue-chartist?

Thank you.