sync slide with charts

parent 1245418e
...@@ -32,6 +32,9 @@ document.getElementById("myChart").onclick = function (evt) { ...@@ -32,6 +32,9 @@ document.getElementById("myChart").onclick = function (evt) {
layerDate: label layerDate: label
}); });
// update date slider
$('input[id="inputRange"]').val(firstPoint._index);
//console.log(myChart.legend.legendItems[firstPoint._datasetIndex].text) //nombre de la capa a la que pertenece (vegetación, agua, etc.) //console.log(myChart.legend.legendItems[firstPoint._datasetIndex].text) //nombre de la capa a la que pertenece (vegetación, agua, etc.)
//if (!firstPoint) return; //if (!firstPoint) return;
activePoints.forEach(function (value, index) { activePoints.forEach(function (value, index) {
......
...@@ -313,8 +313,6 @@ ...@@ -313,8 +313,6 @@
var sliderPos = slider3.value / slider3.max; var sliderPos = slider3.value / slider3.max;
var pixelPostion = slider3.clientWidth * sliderPos; var pixelPostion = slider3.clientWidth * sliderPos;
//this is your pixel value
console.log(pixelPostion);
addImageLayer({ addImageLayer({
layerDate: valor layerDate: valor
...@@ -324,12 +322,9 @@ ...@@ -324,12 +322,9 @@
$("#maptitle").append("Map Date: " + fecha); $("#maptitle").append("Map Date: " + fecha);
$("#tooltiptext").empty(); $("#tooltiptext").empty();
$("#tooltiptext").append(fecha); $("#tooltiptext").append(fecha);
console.log(position);
$("#rangecontrol2").empty(); $("#rangecontrol2").empty();
$("#rangecontrol2").append('<span class="arrow_box" id="tooltiptext">'+fecha+'</span>'); $("#rangecontrol2").append('<span class="arrow_box" id="tooltiptext">'+fecha+'</span>');
$('.arrow_box').css({'left':Math.round(pixelPostion-35) + 'px'}) $('.arrow_box').css({'left':Math.round(pixelPostion-35) + 'px'})
}); });
/* /*
var slider2 = document.getElementById("inputRange"); var slider2 = document.getElementById("inputRange");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment