Add Html Event or Comment to Morris charts

373 views Asked by At

This is a example of Event use in Morris Charts,Now i want to use Html in Event.eg (use img tag in event)

This is added Js code for Event option :

// inject name-drawing
    var originalDrawEvent = Morris.Grid.prototype.drawEvent;
    Morris.Grid.prototype.gridDefaults.eventTextSize = 12;
    Morris.Grid.prototype.drawEvent = function(event, color) {
        originalDrawEvent.apply(this, arguments);

        var idx = $.inArray(event, this.events);
        if(!this.options.eventLabels || !this.options.eventLabels[idx])
            return;

        this.raphael.text(this.transX(event),this.top - this.options.eventTextSize, this.options.eventLabels[idx]).attr('stroke', color).attr('font-size', this.options.eventTextSize);
    }


How can i add Html In to Event, for example i want to add image for event and when i hover it a tooltip of info appear.

Js Bin

Thanks

0

There are 0 answers