Skip to content

Commit

Permalink
merge png-export feature
Browse files Browse the repository at this point in the history
  • Loading branch information
cdcharlebois committed Nov 8, 2017
2 parents eb52995 + 5ecd2e0 commit 3b8d60a
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 7 deletions.
6 changes: 5 additions & 1 deletion src/ChartJS/widgets/BarChart/widget/BarChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,11 @@ define([
scaleLineWidth : this.scaleLineWidth,

//The scale line color
scaleLineColor : this.scaleLineColor
scaleLineColor : this.scaleLineColor,

animation: {
onComplete: lang.hitch(this, this._animationComplete)
}
})
};

Expand Down
6 changes: 6 additions & 0 deletions src/ChartJS/widgets/Core.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ define([
_legendNode: null,
_mxObj: null,
_handle: null,
_dataURL: "",

_chartType: null,

Expand Down Expand Up @@ -700,6 +701,11 @@ define([
if (cb && typeof cb === "function") {
cb();
}
},

_animationComplete: function () {
logger.debug(this.id + "._animationComplete");
// Use this.canvasNode.toDataURL() to get an image
}

});
Expand Down
6 changes: 5 additions & 1 deletion src/ChartJS/widgets/DoughnutChart/widget/DoughnutChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,11 @@ define([
legendCallback: this._legendAlternateCallback,

//Number - The percentage of the chart that we cut out of the middle
cutoutPercentage: this.percentageInnerCutout
cutoutPercentage: this.percentageInnerCutout,

animation: {
onComplete: lang.hitch(this, this._animationComplete)
}
})
});

Expand Down
8 changes: 6 additions & 2 deletions src/ChartJS/widgets/LineChart/widget/LineChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,11 @@ define([
scaleLineWidth: this.scaleLineWidth,

//The scale line color
scaleLineColor: this.scaleLineColor
scaleLineColor: this.scaleLineColor,

animation: {
onComplete: lang.hitch(this, this._animationComplete)
}
})
};

Expand All @@ -235,4 +239,4 @@ define([
});
});

require(["ChartJS/widgets/LineChart/widget/LineChart"]);
require(["ChartJS/widgets/LineChart/widget/LineChart"]);
3 changes: 3 additions & 0 deletions src/ChartJS/widgets/PieChart/widget/PieChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ define([
//cutOut of pie
cutoutPercentage: 0, //always zero for Pie chart

animation: {
onComplete: lang.hitch(this, this._animationComplete)
}
})
};
this._chart = new this._chartJS(this._ctx, chartProperties);
Expand Down
6 changes: 5 additions & 1 deletion src/ChartJS/widgets/PolarChart/widget/PolarChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,11 @@ define([
showTooltips : this.showTooltips,

// Custom tooltip?
customTooltips : false //lang.hitch(this, this.customTooltip)
customTooltips : false, //lang.hitch(this, this.customTooltip)

animation: {
onComplete: lang.hitch(this, this._animationComplete)
}

}
});
Expand Down
6 changes: 5 additions & 1 deletion src/ChartJS/widgets/RadarChart/widget/RadarChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,11 @@ define([
//Boolean - Whether to fill the dataset with a colour
datasetFill : this.datasetFill,

legendCallback : this._legendCallback
legendCallback : this._legendCallback,

animation: {
onComplete: lang.hitch(this, this._animationComplete)
}
})
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,11 @@ define([
scaleLineWidth : this.scaleLineWidth,

//The scale line color
scaleLineColor : this.scaleLineColor
scaleLineColor : this.scaleLineColor,

animation: {
onComplete: lang.hitch(this, this._animationComplete)
}
})
};

Expand Down
Binary file modified test/widgets/ChartJS.mpk
Binary file not shown.

0 comments on commit 3b8d60a

Please sign in to comment.