2

Tooltips work okay when entering piechart 'from outside' but the transition between slices causes the tooltip to disappear & the new one is not created.

Here is my jsfiddle snippet, closely based on helpful advice from this SO answer.

I know that how to get tooltips working for pie as a whole as have see another jsfiddle doing just that but I want the tooltip on top of the specific slice.

I have seen the bubble plots example on http://www.jqplot.com but since it uses plot1b.axes.xaxis etc I dont think it applies easily to pies or donuts?

 $(document).ready(function () {
var data = [
    ['Heavy Industry', 12],['Retail', 9], ['Light Industry', 14], 
    ['Out of home', 16],['Commuting', 7], ['Orientation', 9]
  ];
    plot2 = jQuery.jqplot('chart2', [ data ], {
        seriesDefaults: {
            shadow: false,
            renderer: jQuery.jqplot.PieRenderer,
            rendererOptions: {
                padding: 2,
                sliceMargin: 2,
                showDataLabels: true,

                highlightMouseOver: true
            },
            highlighter: {
                show: true,
                formatString: '%s',
                tooltipLocation: 'sw',
                useAxesFormatters: false
            }
        }
    });

    $('#chart2').bind('jqplotDataHighlight',                    
    function (ev, seriesIndex, pointIndex, data) {
        console.log("jqplotDataHighlight for " + data)
        var $this = $(this);
        $this.attr('title', data[0] + ": " + data[1]);
    });
    $("#chart2").bind('jqplotDataUnhighlight', function (ev, seriesIndex, pointIndex, data) {
        console.log("jqplotDataUnhighlight for " + data)
        var $this = $(this);
        $this.attr('title', "");
    });
});
Community
  • 1
  • 1
k1eran
  • 4,492
  • 8
  • 50
  • 73
  • 2
    it works for me. [jsfiddle link](http://jsfiddle.net/xPCaU/1/) – Gyandeep Feb 20 '14 at 20:48
  • @gyandeep I was using Firefox 27.0.1. Have tried it now on Chrome and Safari & it works on both of them !?! Am not sure on the next step !! I will edit title accordingly. – k1eran Feb 20 '14 at 21:02
  • Try to run firefox in safe mode and see if this helps https://support.mozilla.org/en-US/questions/760472 – Gyandeep Feb 20 '14 at 21:05
  • 1
    @gyandeep Cheers - Further testing show problem occurs on Firefox 27.0.1 (even in safe mode) on both OSX and Windows. All is fine on Chrome or Safari on OSX and Chrome or IE on Windows. Interesting! – k1eran Feb 20 '14 at 22:49

0 Answers0