dojox charting: remove the padding around the char

2019-05-28 18:33发布

How can I move the padding around a dojox chart? Here is an example:

   var chart1 = new dojox.charting.Chart2D("simplechart", {fill:"#FFC0C0"});
   chart1.addPlot("default", {type:"Columns"});
   chart1.addAxis("y", {type:"Invisible", includeZero:true, vertical: true});
   chart1.addSeries("Series 1", [ 4,9,16,25,36,49,64,81,100 ]);
   chart1.render();

Here is the plot generated.

http://www.flickr.com/photos/8110919@N02/5634624479/

Is there a way to remove the pink area around the chart?

Thanks.

2条回答
我只想做你的唯一
2楼-- · 2019-05-28 18:50

i think that you want something like this:

var chart1 = new dojox.charting.Chart2D("chart1", {
    margins: {
        l: -8,
        r: 0,
        t: 0,
        b: 0
    }
});
查看更多
Anthone
3楼-- · 2019-05-28 18:53

Thanks @loops!. But the negative values throw an exception for me. I worked around that by adjusting the CSS margins in the HTML element holding the chart and settings the container's parent's overflow to hidden.

查看更多
登录 后发表回答