Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Metagenomics
metagenedb
Commits
da2a9bc0
Commit
da2a9bc0
authored
Dec 04, 2019
by
Kenzo-Hugo Hillion
♻
Browse files
add dynamic label for hide fields
parent
75246de9
Pipeline
#19261
passed with stages
in 2 minutes and 10 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
frontend/src/components/Doughnut.vue
View file @
da2a9bc0
...
...
@@ -24,7 +24,7 @@
:items=
"this.labels"
attach
chips
label=
"
H
ide
fields
"
:
label=
"
h
ide
LabelsLabel
"
multiple
></v-select>
</v-flex>
...
...
@@ -43,6 +43,17 @@ export default {
required
:
true
,
},
},
data
()
{
return
{
myChart
:
{},
options
:
{},
colors
:
[],
chartId
:
"
myChart
"
,
displayLegend
:
true
,
labels
:
[],
hideLabels
:
[],
}
},
watch
:
{
doughnutData
(
val
)
{
this
.
updateChart
();
...
...
@@ -54,16 +65,14 @@ export default {
this
.
updateChartData
();
}
},
data
()
{
return
{
myChart
:
{},
options
:
{},
colors
:
[],
chartId
:
"
myChart
"
,
displayLegend
:
true
,
labels
:
[],
hideLabels
:
[],
}
computed
:
{
hideLabelsLabel
()
{
if
(
Object
.
entries
(
this
.
doughnutData
).
length
==
0
)
{
return
"
Hide fields
"
;
}
else
{
return
"
Hide
"
+
this
.
doughnutData
.
level
;
}
},
},
mounted
()
{
this
.
createChart
(
this
.
chartId
);
...
...
@@ -84,13 +93,13 @@ export default {
this
.
updateChartOptions
();
this
.
updateChartData
();
},
generateColorList
()
{
generateColorList
()
{
// # TODO get out of this and refactor -> return list of colors
this
.
color
=
[];
for
(
var
i
=
0
;
i
<
Object
.
keys
(
this
.
doughnutData
.
data
).
length
;
i
++
)
{
this
.
colors
.
push
(
this
.
generateColor
())
}
},
generateColor
()
{
generateColor
()
{
// Same as above
var
letters
=
'
0123456789ABCDEF
'
;
var
color
=
'
#
'
;
for
(
var
i
=
0
;
i
<
6
;
i
++
)
{
...
...
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