JqPlot pie chart jqplot-event-canvas position top left

graph, javascript, jqplot, jquery, pie-chart

Solution

Try setting the `gridPadding` like this:

var plot1 = $.jqplot('pie1', [data], {
    gridPadding: {top:0, bottom:0, left:0, right:0},
....

Because by default, each plot has the following grid padding:

{top:10, right:10, bottom:23, left:10};

I think this might explain the issue you are seeing.

Problem

I've just started using JqPlot and want to display a small chart However there is always a small margin at the top and to the left. Looking at the css produced the jqplot-event-canvas is given absolute position with top and left set at 10px. Is there a simple way to solve this so that the pie is positioned without the extra spacing? I've tried to set the padding to 0 in the grid and pie rendererOptions. Also set show:false on the axes, title, ledgend ..., Any ideas?

Original source