最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - JqPlot pie chart jqplot-event-canvas position top left - Stack Overflow

programmeradmin0浏览0评论

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?

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?

Share asked Dec 4, 2012 at 14:40 jimmyjimmy 7563 gold badges17 silver badges34 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 8

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.

发布评论

评论列表(0)

  1. 暂无评论