Morris graphs. Have custom tooltip when hover

前端 未结 2 552
失恋的感觉
失恋的感觉 2020-12-09 19:50

I am using morris.js (which has a dependency on raphael) for creating stacked bar graphs. For each stacked bar I want to show the split for the various levels in the bar as

2条回答
  •  情深已故
    2020-12-09 20:38

    http://jsbin.com/finuqazofe/1/edit?html,js,output

    { y: ..., x: ..., label: "my own label"},'
    
    ...
    Morris.Line({
        hoverCallback: function(index, options, content) {
            var data = options.data[index];
            $(".morris-hover").html('
    Custom label: ' + data.label + '
    '); }, ... other params });

提交回复
热议问题