dojox charting: remove the padding around the chart

社会主义新天地 提交于 2019-12-07 18:48:17

问题


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.


回答1:


i think that you want something like this:

var chart1 = new dojox.charting.Chart2D("chart1", {
    margins: {
        l: -8,
        r: 0,
        t: 0,
        b: 0
    }
});



回答2:


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.



来源:https://stackoverflow.com/questions/5719495/dojox-charting-remove-the-padding-around-the-chart

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!