-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsym-test.js
53 lines (40 loc) · 1.11 KB
/
sym-test.js
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
(function (PV) {
'use strict';
function symbolVis() { };
PV.deriveVisualizationFromBase(symbolVis);
var definition = {
typeName: 'test',
visObjectType: symbolVis,
datasourceBehavior: PV.Extensibility.Enums.DatasourceBehaviors.Multiple,
getDefaultConfig: function(){
return {
DataShape: "Timeseries",
Height: 150,
Width: 150,
}
},
}
symbolVis.prototype.init = function(scope, elem) {
this.onDataUpdate = dataUpdate;
/*function convertToChart(data){
return data.Rows.map(function(item){
return{
value: item.Value,
attribute: item.Label
}
});
}*/
function dataUpdate(newdata){
//var chartData = convertToChart(newData)
//console.log(chartData);
if(!newdata) return;
var firstAttribute = newdata.Data[0];
scope.Values = firstAttribute.Values;
if(firstAttribute.Label){
scope.Label = firstAttribute.Label;
scope.UOM = firstAttribute.Units;
}
}
};
PV.symbolCatalog.register(definition);
})(window.PIVisualization);