-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathbarsPlus.js
More file actions
61 lines (58 loc) · 1.5 KB
/
Copy pathbarsPlus.js
File metadata and controls
61 lines (58 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/**
* barsPlus extension
*
* Set up Qlik Sense interface
*
* Note that the paint routine is used for only two purposes:
*
* 1) To save a reference to 'this' for calling the backendApi
* 2) To refresh the chart when changes are made in edit mode
*
* See barsPlus-directive.js for the AngularJS directive
* Most core processing is performed in ldw-barsPlus.js
*
* Author: L. Woodside
* Modification History:
*
* Version Person Date Description
* V1.0.0 L. Woodside 19-Dec-2016 Initial Release
* V1.1.0 L. Woodside 29-Dec-2016 Added text on bars
* V1.2.0 L. Woodside 07-Jan-2017 Allow multiple measures
*
*/
define( [
"jquery",
"./barsPlus-initprops",
"./barsPlus-props",
"text!./barsPlus-template.html",
"./barsPlus-directive"
],
function ($, initprops, props, template) {
'use strict';
return {
initialProperties: initprops,
definition: props,
support: {
snapshot: true,
export: true,
exportData : true
},
// resize: function($element, layout) {
// console.log('resize>',$element,layout,$element.scope());
// },
template: template,
controller: ['$scope', function($scope) {
}],
paint: function ($element, layout) {
var self = this;
self.$scope.g.self = self; // Save reference for call to backendApi
// Only repaint here when in edit mode
self.$scope.g.editMode = (self.options.interactionState == 2);
if (self.$scope.g.editMode) {
self.$scope.initProps();
self.$scope.g.initData();
self.$scope.g.refreshChart();
}
}
};
});