morrisjs / morris.js

Pretty time-series line graphs
http://morrisjs.github.com/morris.js/
6.91k stars 1.23k forks source link

how to show image over each bar #721

Open kamrane opened 7 years ago

kamrane commented 7 years ago

hi how can I do it?

dashboard

kamrane commented 7 years ago

I do this but is'nt good

first adding ` Bar.prototype.drawImage = function (src, x, y, width, height) { var image = this.raphael.image(src, x, y, width, height);

    return image;
};`

then use it after "this.drawBar(..."

if (this.data[sidx].src.image != undefined) { this.drawImage(this.data[sidx].src.image, this.left + idx * groupWidth, this.top - groupWidth - 10, groupWidth, this.top, groupWidth); } each record most include image like it { y: 'y label', a: 100, b: 90, c: 40, image: '/assets/images/img.png' },