Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
GeoInt_SIDT
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mario Chirinos Colunga
GeoInt_SIDT
Commits
e5be4d17
Commit
e5be4d17
authored
Mar 28, 2019
by
Emmanuel René Huchim Puc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chart bug fixed
parent
1ab26fd6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
39 deletions
+12
-39
sclData.html
reports/templates/sclData.html
+12
-39
No files found.
reports/templates/sclData.html
View file @
e5be4d17
...
...
@@ -323,49 +323,22 @@
</script>
<!-- page script -->
<script>
var
defaultLegendClickHandler
=
Chart
.
defaults
.
global
.
legend
.
onClick
;
var
newLegendClickHandler
=
function
(
e
,
legendItem
)
{
var
legendOnClickHandler
=
function
(
e
,
legendItem
)
{
var
index
=
legendItem
.
datasetIndex
;
var
ch
=
this
.
chart
;
var
meta
=
ch
.
getDatasetMeta
(
index
);
var
layer
=
legendItem
.
text
.
toLowerCase
().
replace
(
/
\s
/g
,
'-'
);
let
checkbox_id
=
'#sclcheck-'
+
layer
;
var
activePoint
=
ch
.
getElementAtEvent
(
e
);
let
checkbox_id
=
'#sclcheck-'
+
legendItem
.
text
.
toLowerCase
().
replace
(
/
\s
/g
,
'-'
);
// isDatasetVisible return the opposite status?
// change checkbox in imagelayer
if
(
ch
.
getDatasetMeta
(
index
).
hidden
===
null
)
{
ch
.
getDatasetMeta
(
index
).
hidden
=
false
;
}
else
{
ch
.
getDatasetMeta
(
index
).
hidden
=
!
ch
.
getDatasetMeta
(
index
).
hidden
;
}
ch
.
update
();
$
(
checkbox_id
+
" :input"
).
prop
(
"checked"
,
!
ch
.
isDatasetVisible
(
index
)
);
$
(
checkbox_id
+
" :input"
).
prop
(
"checked"
,
!
ch
.
getDatasetMeta
(
index
).
hidden
);
addImageLayer
(
currentDate
);
// myChart.config.data.datasets
// myChart.getDatasetMeta(4).hidden=true
//console.log(document.getElementById("titleMap").textContent)
// var label = document.getElementById("titleMap").textContent; //obtiene la fecha que se está viendo
// label = label.replace(/\//g,''); // reemplaza los diagonales por nada
// console.log(label)
// if(meta.hidden){
// console.log("Mostrar!!!")
// SCLlayers.push(layer)
// document.getElementById("scl_"+layer).src = "../../static/reports/tmpImages/repsat_test_dev/{{ SCL_PATH }}"+label+"_SCL_60m_"+layer+".png"
// }
// else{
// console.log("Ocultar!!")
// SCLlayers.splice(SCLlayers.indexOf(layer), 1);
// document.getElementById("scl_"+layer).src = ""
// }
//if (index > 1) {
// Do the original logic
//console.log("wooooo")
//defaultLegendClickHandler(e, legendItem);
defaultLegendClickHandler
.
call
(
this
,
e
,
legendItem
);
//} else {
// console.log("holaaaa")
//}
};
var
showSCLcheckboxes
=
function
(
datasets
)
{
...
...
@@ -402,8 +375,8 @@
maintainAspectRatio
:
false
,
// scales: { xAxes: [{ stacked: true }], yAxes: [{ stacked: true }] },
legend
:
{
display
:
true
,
onClick
:
newLegend
ClickHandler
,
display
:
true
,
onClick
:
legendOn
ClickHandler
,
}
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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