Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
trivalent
dashboard-trivalent
Commits
d3185e2c
Commit
d3185e2c
authored
Jun 12, 2019
by
Francisco Jesús Acién Pérez
Browse files
solving error while representing linear chart
parent
82415635
Pipeline
#1548
passed with stages
in 5 minutes and 54 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Dockerfile
View file @
d3185e2c
from
node:7.10.0
RUN
printf
"deb http://archive.debian.org/debian/ jessie main
\n
deb-src http://archive.debian.org/debian/ jessie main
\n
deb http://security.debian.org jessie/updates main
\n
deb-src http://security.debian.org jessie/updates main"
>
/etc/apt/sources.list
# Install gettext to get envsubst
RUN
apt-get update
&&
apt-get
install
-y
gettext
...
...
demo/elements/google-chart-elasticsearch/google-chart.html
View file @
d3185e2c
...
...
@@ -102,7 +102,7 @@ Data can be provided in one of three ways:
},
data
:
{
type
:
Object
,
observer
:
'
_dataChanged
'
observer
:
'
_dataChanged
'
},
/**
* Sets the options for the chart.
...
...
@@ -259,7 +259,7 @@ Data can be provided in one of three ways:
type
:
Array
,
notify
:
true
,
value
:
function
()
{
return
[];
}
},
},
isSelected
:
{
type
:
Boolean
,
value
:
false
...
...
@@ -314,7 +314,7 @@ Data can be provided in one of three ways:
term1
[
field
]
=
param
}
if
(
sel
==
null
){
//console.log("inside")
...
...
@@ -327,7 +327,7 @@ Data can be provided in one of three ways:
console
.
log
(
value
)
var
sources
=
this
.
sources
for
(
var
key
in
sources
){
if
(
key
.
search
(
value
)
>=
0
){
console
.
log
(
key
)
param
=
key
...
...
@@ -352,14 +352,14 @@ Data can be provided in one of three ways:
}*/
console
.
log
(
value
)
for
(
var
key
in
sources
){
if
(
key
.
search
(
value
)
>=
0
){
console
.
log
(
key
)
param
=
key
break
}
}
term1
[
field
]
=
param
;
}
...
...
@@ -374,13 +374,13 @@ Data can be provided in one of three ways:
var
term
=
date
[
1
]
+
'
-
'
+
date
[
0
]
+
'
-01
'
object
=
{
range
:
{
'
schema:datePublished
'
:
{
gte
:
term
,
boost
:
5
}}}
}
var
isInside
=
-
1
for
(
var
i
=
0
;
i
<
this
.
filters
.
length
;
i
++
){
if
(
JSON
.
stringify
(
this
.
filters
[
i
].
term
)
===
JSON
.
stringify
(
term1
))
isInside
=
i
}
if
(
isInside
==
-
1
){
//console.log("Dentro")
this
.
push
(
'
filters
'
,
object
)
...
...
@@ -535,7 +535,7 @@ Data can be provided in one of three ways:
if
(
!
data
)
{
data
=
this
.
data
;
//console.log(data['aggregations']['schema:author']['buckets'][1])
}
if
(
!
data
)
data
=
[];
...
...
@@ -563,16 +563,28 @@ Data can be provided in one of three ways:
['2007', 1030, 540]
];
console.log(data)*/
/*this.rows.push(["8-2018", 5, 3, 1])
/*this.rows.push(["8-2018", 5, 3, 1])
this.rows.push(["9-2018", 2, 5, 4])
this.rows.push(["10-2018", 5, 3, 1])
this.rows.push(["10-2018", 5, 3, 1])
this.rows.push(["12-2018", 1, 2, 4])*/
//console.log(this.rows)
if
(
this
.
rows
&&
this
.
cols
)
{
dataTable
=
new
google
.
visualization
.
DataTable
(
this
.
rows
);
}
else
if
(
this
.
rows
.
length
>
0
)
{
dataTable
=
google
.
visualization
.
arrayToDataTable
(
this
.
rows
);
// There is an error when rows have not the same length, we have to
// delete unnecesary data from rows (undefined values)
var
numCols
=
0
;
for
(;
this
.
rows
[
0
][
numCols
]
!=
undefined
;
numCols
++
);
// Make sure that rows have the same length
for
(
var
i
=
0
;
i
<
this
.
rows
.
length
;
i
++
){
this
.
rows
[
i
].
splice
(
numCols
);
}
dataTable
=
google
.
visualization
.
arrayToDataTable
(
this
.
rows
);
}
}
return
dataTable
;
...
...
@@ -604,7 +616,7 @@ Data can be provided in one of three ways:
//var column_titles=["Date", "cnn", "Al Jazeera", "The New York Times"]
var
sources
=
this
.
data
.
aggregations
[
'
schema:author
'
].
buckets
//console.log(sources)
sources
.
forEach
(
function
(
source
){
//console.log(source)
if
(
source
.
key
.
search
(
"
Twitter
"
)
<
0
&&
source
.
key
.
search
(
"
Rumiyah
"
)
<
0
&&
source
.
key
.
search
(
"
Dabiq
"
)
<
0
)
...
...
@@ -641,7 +653,7 @@ Data can be provided in one of three ways:
}
}
else
{
data
=
[]
}
}
//console.log(data)
}
else
if
(
this
.
field
==
"
schema:author
"
){
...
...
@@ -674,7 +686,7 @@ Data can be provided in one of three ways:
}
}
});
})();
</script>
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment