swagchart 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/swagchart/helper.rb +6 -4
- data/lib/swagchart/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81a352f95a40dce5ddd0441a2154f642d58a5e15
|
4
|
+
data.tar.gz: 4a0e6a94becf3620abaaadf5a12e133fa7b4ee26
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d888c11d4fe9d028719906bad63247516b9343db3496cfb94a1db456976834ca8165f098856d51a31f98de7e7605f733c4fa540a7e11226b26d3959d88ed1c9
|
7
|
+
data.tar.gz: 7673f69c369be00ca618dd1709bf5aa6bb2c9fb5015b06d547e64dee2aaa4de984120f3b3fd3207e9c89565929189600968fa2cf9acdec502be7e25bc041720a
|
data/lib/swagchart/helper.rb
CHANGED
@@ -49,11 +49,13 @@ module Swagchart
|
|
49
49
|
end
|
50
50
|
|
51
51
|
def autocast_data_template
|
52
|
-
js =
|
53
|
-
js << 'if(
|
54
|
-
js <<
|
52
|
+
js = ''
|
53
|
+
js << 'if(Array.isArray(data) && !Array.isArray(data[0])){'
|
54
|
+
js << 'var keys=[], vals=[], row=[]; for(var k in data[0]){keys.push(k)}; for(var d in data){row=[]; for(var k in keys){row.push(data[d][keys[k]])}; vals.push(row)}; vals.unshift(keys); data = vals;'
|
55
|
+
js << '}else{data.unshift(Array(data[0].length).join(".").split("."));}'
|
56
|
+
js << "for(var i=0;i<data.length;i++){for(var j=0;j<data[i].length;j++){if(typeof data[i][j] === 'string'){"
|
57
|
+
js << 'var pd = Date.parse(data[i][j]); if(!isNaN(pd)){data[i][j] = new Date(pd)};'
|
55
58
|
js << "}}};"
|
56
|
-
js << "data.unshift(Array(data[0].length).join('.').split('.'));"
|
57
59
|
js
|
58
60
|
end
|
59
61
|
|
data/lib/swagchart/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: swagchart
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- pachacamac
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-04-
|
12
|
+
date: 2016-04-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|