sinatra-hexacta 1.1.3 → 1.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sinatra/views/charts/pie.slim +37 -34
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 624ee7c381d7793171661f38711d7a3d5b269a9517363d1dab778baee42cf770
|
4
|
+
data.tar.gz: 1d47e583f1f8e16f4af003bcc918745f61205b3bcb0a060454e577bcaf6fe2f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4dd4d4e9749696e47b66409203c82468be0fcc35deecda306e542d4b70c59299f33c676ae246c7f67a323fcc04212f19dd3839769b06f7d4e1c5daebde36f0bb
|
7
|
+
data.tar.gz: 64356f393cbe8b8b207fdc8cd63a56ef8038df92e68ab4aa16ca758dbeff0421a8034058e09ae335a4f92ad73acf8c02b3e32010e34d08efb004104ecc4499d1
|
@@ -1,38 +1,41 @@
|
|
1
|
-
|
1
|
+
-if serie.empty?
|
2
|
+
== empty_alert({ :title => "Sin datos suficientes", :message => "No hay suficientes datos para mostrar esta información."})
|
3
|
+
-else
|
4
|
+
.ct-chart.pie id="#{id}"
|
2
5
|
|
3
|
-
.table-responsive.chart-table
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
6
|
+
.table-responsive.chart-table
|
7
|
+
table.table.table-striped
|
8
|
+
tbody
|
9
|
+
tr
|
10
|
+
-for label in labels
|
11
|
+
th #{label}
|
12
|
+
tr
|
13
|
+
-for element in serie
|
14
|
+
td #{element}
|
15
|
+
tr
|
16
|
+
-total = [1,serie.reduce(:+)].max
|
17
|
+
-for element in serie
|
18
|
+
td #{(element.to_f*100/total).round(0)}%
|
16
19
|
|
17
|
-
javascript:
|
18
|
-
|
19
|
-
|
20
|
+
javascript:
|
21
|
+
var labels = #{{labels}};
|
22
|
+
var serie = #{{serie}};
|
20
23
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
24
|
+
new Chartist.Pie("##{id}", {
|
25
|
+
labels: labels,
|
26
|
+
series: serie
|
27
|
+
}, {
|
28
|
+
fullWidth: true,
|
29
|
+
showLabel: false,
|
30
|
+
height: '300px',
|
31
|
+
plugins: [
|
32
|
+
Chartist.plugins.legend()
|
33
|
+
]
|
34
|
+
}
|
35
|
+
);
|
33
36
|
|
34
|
-
css:
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
37
|
+
css:
|
38
|
+
.pie .ct-legend.ct-legend-inside {
|
39
|
+
position: absolute;
|
40
|
+
top: 60px;
|
41
|
+
}
|