Skip to content

Commit

Permalink
Merging in pull request 114 (add chart margin support to themes) fixe…
Browse files Browse the repository at this point in the history
…s: #18079
  • Loading branch information
Kagetsume committed Jul 17, 2014
1 parent 5c5dab6 commit c82a1d1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions charting/Chart.js
Expand Up @@ -49,7 +49,8 @@ define(["../main", "dojo/_base/lang", "dojo/_base/array","dojo/_base/declare", "
destroy = func.lambda("item.destroy()"),
makeClean = func.lambda("item.dirty = false"),
makeDirty = func.lambda("item.dirty = true"),
getName = func.lambda("item.name");
getName = func.lambda("item.name"),
defaultMargins = {l: 10, t: 10, r: 10, b: 10};

var Chart = declare(has("dojo-bidi")? "dojox.charting.NonBidiChart" : "dojox.charting.Chart", null, {
// summary:
Expand Down Expand Up @@ -160,7 +161,8 @@ define(["../main", "dojo/_base/lang", "dojo/_base/array","dojo/_base/declare", "

// initialize parameters
if(!kwArgs){ kwArgs = {}; }
this.margins = kwArgs.margins ? kwArgs.margins : {l: 10, t: 10, r: 10, b: 10};
this.margins = kwArgs.margins || defaultMargins;
this._customMargins = !!kwArgs.margins;
this.stroke = kwArgs.stroke;
this.fill = kwArgs.fill;
this.delayInMs = kwArgs.delayInMs || 200;
Expand Down Expand Up @@ -227,6 +229,9 @@ define(["../main", "dojo/_base/lang", "dojo/_base/array","dojo/_base/declare", "
// returns: dojox/charting/Chart
// A reference to the current chart for functional chaining.
this.theme = theme.clone();
if(!this._customMargins){
this.margins = this.theme.chart.margins || defaultMargins;
}
this.dirty = true;
return this; // dojox/charting/Chart
},
Expand Down
1 change: 1 addition & 0 deletions charting/SimpleTheme.js
Expand Up @@ -44,6 +44,7 @@ define(["dojo/_base/lang", "dojo/_base/array","dojo/_base/declare","dojo/_base/C
// The default theme (and structure) looks like so:
// | // all objects are structs used directly in dojox.gfx
// | chart:{
// | margins: {l: 10, t: 10, r: 10, b: 10},
// | stroke: null,
// | fill: "white",
// | pageStyle: null // suggested page style as an object suitable for dojo.style()
Expand Down

0 comments on commit c82a1d1

Please sign in to comment.