diff --git a/src/ChartJS/widgets/Core.js b/src/ChartJS/widgets/Core.js index 90e6316..b36f517 100644 --- a/src/ChartJS/widgets/Core.js +++ b/src/ChartJS/widgets/Core.js @@ -28,20 +28,20 @@ define([ "dojo/text!ChartJS/templates/chartjs.html", "dojo/text!ChartJS/templates/tooltip.html" -], function ( +], function( - // Mixins - declare, _WidgetBase, _TemplatedMixin, + // Mixins + declare, _WidgetBase, _TemplatedMixin, - // Client API and DOJO functions - dom, dojoDom, domQuery, domProp, domGeom, domClass, domAttr, domStyle, win, domConstruct, dojoArray, lang, html, ready, + // Client API and DOJO functions + dom, dojoDom, domQuery, domProp, domGeom, domClass, domAttr, domStyle, win, domConstruct, dojoArray, lang, html, ready, - // External libraries - _charts, + // External libraries + _charts, - // Templates - _chartJSTemplate, - _chartJSTooltipTemplate) { + // Templates + _chartJSTemplate, + _chartJSTooltipTemplate) { "use strict"; @@ -77,7 +77,7 @@ define([ _tooltipNode: null, - startup: function () { + startup: function() { logger.debug(this.id + ".startup"); var domNode = null; @@ -112,12 +112,12 @@ define([ // domConstruct.place(this._tooltipNode, win.body()); // } - this.connect(this.mxform, "resize", lang.hitch(this, function () { + this.connect(this.mxform, "resize", lang.hitch(this, function() { this._resize(); })); }, - datasetAdd: function (dataset, datapoints) { + datasetAdd: function(dataset, datapoints) { logger.debug(this.id + ".datasetAdd"); var set = { dataset: dataset, @@ -138,7 +138,7 @@ define([ } }, - update: function (obj, callback) { + update: function(obj, callback) { logger.debug(this.id + ".update"); this._mxObj = obj; @@ -164,14 +164,14 @@ define([ this._executeCallback(callback, "update"); }, - _loadData: function () { + _loadData: function() { logger.debug(this.id + "._loadData"); this._data = { object: this._mxObj, datasets: [] }; - this._executeMicroflow(this.datasourcemf, lang.hitch(this, function (objs) { + this._executeMicroflow(this.datasourcemf, lang.hitch(this, function(objs) { if (objs && objs.length > 0) { var obj = objs[0], // Chart object is always only one. j = null, @@ -190,7 +190,7 @@ define([ // Retrieve datasets mx.data.get({ guids: guids, - callback: lang.hitch(this, function (datasets) { + callback: lang.hitch(this, function(datasets) { var set = {}; this._datasetCounter = datasets.length; @@ -221,7 +221,7 @@ define([ }, - _loadDataSingleSet: function () { + _loadDataSingleSet: function() { logger.debug(this.id + "._loadDataSingleSet"); this._executeMicroflow(this.datasourcemf, lang.hitch(this, function(objs) { if (objs && objs.length > 0) { @@ -256,7 +256,7 @@ define([ }), this._mxObj); }, - uninitialize: function () { + uninitialize: function() { logger.debug(this.id + ".uninitialize"); //console.log(this._data); @@ -291,7 +291,7 @@ define([ if (this._data.object && this._data.object.getGuid) { if (this.onDestroyMf) { - this._executeMicroflow(this.onDestroyMf, lang.hitch(this, function () { + this._executeMicroflow(this.onDestroyMf, lang.hitch(this, function() { logger.debug(this.id + ".uninitialize release obj " + this._data.object.getGuid()); mx.data.release(this._data.object); }), this._data.object); @@ -303,7 +303,7 @@ define([ } }, - customTooltip: function (tooltip) { + customTooltip: function(tooltip) { logger.debug(this.id + ".customTooltip"); // Tooltip Element var tooltipEl = domQuery("#chartjsTooltip")[0], @@ -332,7 +332,7 @@ define([ location: "content", context: contextObj, domNode: tooltipElContent, - callback: function (form) { + callback: function(form) { var whatEver = null; } }, this); @@ -359,7 +359,7 @@ define([ }, - _createCtx: function () { + _createCtx: function() { logger.debug(this.id + "._createCtx"); var position = domGeom.position(this.domNode.parentElement, false); domAttr.set(this.canvasNode, "id", "canvasid_" + this.id); @@ -386,26 +386,26 @@ define([ }, - _processData: function () { + _processData: function() { // STUB console.error("_processData: This is placeholder function that should be overwritten by the implementing widget."); }, - _createChart: function (data) { + _createChart: function(data) { // STUB console.error("_createChart: This is placeholder function that should be overwritten by the implementing widget.", data); }, - _onClickChart: function (evt) { + _onClickChart: function(evt) { logger.debug(this.id + "._onClickChart"); var elements = this._chart.getElementAtEvent(evt); if (elements.length) { var el = elements[0], - datasetIndex = el._datasetIndex, - pointIndex = el._index, - dataset = this._data.datasets[datasetIndex], - datasetObject = dataset ? dataset.dataset : null, - dataPointObject = dataset && dataset.points ? dataset.points[pointIndex] : null; + datasetIndex = el._datasetIndex, + pointIndex = el._index, + dataset = this._data.datasets[datasetIndex], + datasetObject = dataset ? dataset.dataset : null, + dataPointObject = dataset && dataset.points ? dataset.points[pointIndex] : null; if (this.onclickDataSetMf && datasetObject) { if (this._chartType === "pie" || this._chartType === "doughnut" || this._chartType === "polarArea") { @@ -426,7 +426,7 @@ define([ } }, - _createLegend: function (isSingleSeries) { + _createLegend: function(isSingleSeries) { logger.debug(this.id + "._createLegend"); var listNodes = null, k = null; @@ -444,7 +444,7 @@ define([ } }, - _legendCallback: function (chart) { + _legendCallback: function(chart) { logger.debug(this.id + "._legendCallback"); var text = []; text.push("