a1f0799c
isisadmin
datalet global re...
|
1
|
<link rel="import" href="../base-ajax-json-jsonpath-datalet/base-ajax-json-jsonpath-datalet.html">
|
73bcce88
luigser
COMPONENTS
|
2
3
|
<dom-module id="highcharts-datalet">
|
a1f0799c
isisadmin
datalet global re...
|
4
|
|
73bcce88
luigser
COMPONENTS
|
5
6
|
<template>
<div id="container" style="width:auto; height:auto;"></div>
|
a1f0799c
isisadmin
datalet global re...
|
7
|
<base-ajax-json-jsonpath-datalet data-url="{{dataUrl}}" fields="{{fields}}"></base-ajax-json-jsonpath-datalet>
|
73bcce88
luigser
COMPONENTS
|
8
|
</template>
|
a1f0799c
isisadmin
datalet global re...
|
9
|
|
73bcce88
luigser
COMPONENTS
|
10
11
|
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="http://code.highcharts.com/modules/exporting.js"></script>
|
a1f0799c
isisadmin
datalet global re...
|
12
|
|
73bcce88
luigser
COMPONENTS
|
13
14
|
<script>
var HighchartsBehavior = {
|
a1f0799c
isisadmin
datalet global re...
|
15
|
|
73bcce88
luigser
COMPONENTS
|
16
|
properties: {
|
a1f0799c
isisadmin
datalet global re...
|
17
|
|
73bcce88
luigser
COMPONENTS
|
18
19
20
21
|
categories: {
type: Array,
value: []
},
|
a1f0799c
isisadmin
datalet global re...
|
22
|
|
73bcce88
luigser
COMPONENTS
|
23
24
25
26
|
series: {
type: Array,
value: []
},
|
a1f0799c
isisadmin
datalet global re...
|
27
|
|
73bcce88
luigser
COMPONENTS
|
28
29
30
31
32
|
series_type:{
type: String,
value: "line"//spline,time
}
},
|
a1f0799c
isisadmin
datalet global re...
|
33
|
|
73bcce88
luigser
COMPONENTS
|
34
|
selectData: function () {
|
a1f0799c
isisadmin
datalet global re...
|
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
this.properties.categories.value = this.data[0].data;
for (var i = 1; i < this.data.length; i++)
{
this.data[i].data.every(function (element, index, array) {
try {
(isNaN(parseFloat(element))) ? array[index] = parseFloat(element.match(/[0-9]+/g).join(".")) :
array[index] = parseFloat(element);
}catch(e){
//console.log("Parsing data error. Highchart-datalet.selectData");
}
return true;
});
this.properties.series.value.push(this.data[i]);
|
73bcce88
luigser
COMPONENTS
|
52
53
54
55
|
}
}
};
|
a1f0799c
isisadmin
datalet global re...
|
56
|
var HighchartsComponentBehavior = $.extend(true, {}, BaseDataletBehavior, WorkcycleBehavior, AjaxJsonJsonPathBehavior, HighchartsBehavior);
|
73bcce88
luigser
COMPONENTS
|
57
58
59
60
61
62
63
|
HighchartsDatalet = Polymer({
is : 'highcharts-datalet'
});
</script>
</dom-module>
|