Skip to content Skip to sidebar Skip to footer

Add Legend To Donut Chart - Jqplot

OK, this should be relatively simple : I'm adding a donut chart, which does work However, the 'legend' (like Head (+) along with the corresponding colour) does NOT show up. Code

Solution 1:

Kameleon,

It looks like you have done a silly mistake. : )

First end the seriesDefaults property and then define the legend.

You have placed the legend inside the seriesDefaults.

var plot3 = $.jqplot('linkchart', [s1,s2], {
    title:"Score Profile",
        seriesDefaults: {
            // make this a donut chart.renderer:$.jqplot.DonutRenderer,
            rendererOptions:{
                // Donut's can be cut into slices like pies.sliceMargin: 3,
                // Pies and donuts can start at any arbitrary angle.startAngle: -90,
                showDataLabels: false
            } // Not here...
        },
        //Place the legend here....legend: { show:true, location: 'e' }
    });
});

I have not tested it. But I think it should work.

Thank you.

Post a Comment for "Add Legend To Donut Chart - Jqplot"