$(document).ready(function(){ $.jqplot.sprintf.thousandsSeparator = '.'; /* Datuak HTML-aren hizkuntzaren arabera kargatzen dira */ var language = document.getElementById("language").value /* Grafikoa Y ardatzean ondo ikusteko gehitzen zaion kopurua */ var yAddedQuantity_GRI_170117_Gasto9_PIB_Prestaciones_NP = 0.5 /* Serieen datak hartzen ditu */ var datesArray_GRI_170117_Gasto9_PIB_Prestaciones_NP = datajson_GRI_170117_Gasto9_PIB_Prestaciones_NP[0] /* Grafikoaren titulu, azpititulu eta oina hartzen ditu jizkuntzaren arabera */ var graphNames_GRI_170117_Gasto9_PIB_Prestaciones_NP = getGraphNames(datajson_GRI_170117_Gasto9_PIB_Prestaciones_NP, language) document.getElementById("graphTitle_GRI_170117_Gasto9_PIB_Prestaciones_NP").innerHTML=graphNames_GRI_170117_Gasto9_PIB_Prestaciones_NP[0][1]; document.getElementById("graphSubtitle_GRI_170117_Gasto9_PIB_Prestaciones_NP").innerHTML=graphNames_GRI_170117_Gasto9_PIB_Prestaciones_NP[1][1]; document.getElementById("graphFoot_GRI_170117_Gasto9_PIB_Prestaciones_NP").innerHTML=graphNames_GRI_170117_Gasto9_PIB_Prestaciones_NP[2][1]; /* Serieen tituluak hartzen ditu hizkuntzaren arabera*/ var serieNames_GRI_170117_Gasto9_PIB_Prestaciones_NP = getSerieNames(datajson_GRI_170117_Gasto9_PIB_Prestaciones_NP, language) document.getElementById("serie1Name_GRI_170117_Gasto9_PIB_Prestaciones_NP").innerHTML=serieNames_GRI_170117_Gasto9_PIB_Prestaciones_NP[0]; document.getElementById("serie2Name_GRI_170117_Gasto9_PIB_Prestaciones_NP").innerHTML=serieNames_GRI_170117_Gasto9_PIB_Prestaciones_NP[1]; document.getElementById("serie3Name_GRI_170117_Gasto9_PIB_Prestaciones_NP").innerHTML=serieNames_GRI_170117_Gasto9_PIB_Prestaciones_NP[2]; /* Serie guztien Array-a */ var series_GRI_170117_Gasto9_PIB_Prestaciones_NP = createSeriesNoDecimal(datajson_GRI_170117_Gasto9_PIB_Prestaciones_NP); /* Serie kopurua definitu */ var s1_GRI_170117_Gasto9_PIB_Prestaciones_NP = series_GRI_170117_Gasto9_PIB_Prestaciones_NP[0] var s2_GRI_170117_Gasto9_PIB_Prestaciones_NP = series_GRI_170117_Gasto9_PIB_Prestaciones_NP[1] var s3_GRI_170117_Gasto9_PIB_Prestaciones_NP = series_GRI_170117_Gasto9_PIB_Prestaciones_NP[2] /* Slider-aren minimoa eta maximoa */ var minSlider_GRI_170117_Gasto9_PIB_Prestaciones_NP = 0 var maxSlider_GRI_170117_Gasto9_PIB_Prestaciones_NP = s1_GRI_170117_Gasto9_PIB_Prestaciones_NP.length - 1 /* Slider-aren hasierako eta amaierako balioak lortzen dira*/ var firstRangeDate_GRI_170117_Gasto9_PIB_Prestaciones_NP = datajson_GRI_170117_Gasto9_PIB_Prestaciones_NP[datajson_GRI_170117_Gasto9_PIB_Prestaciones_NP.length-1][0] var lastRangeDate_GRI_170117_Gasto9_PIB_Prestaciones_NP = datajson_GRI_170117_Gasto9_PIB_Prestaciones_NP[datajson_GRI_170117_Gasto9_PIB_Prestaciones_NP.length-1][1] var minSliderPos_GRI_170117_Gasto9_PIB_Prestaciones_NP = getPositionInArrayOfDate(datesArray_GRI_170117_Gasto9_PIB_Prestaciones_NP, firstRangeDate_GRI_170117_Gasto9_PIB_Prestaciones_NP) var maxSliderPos_GRI_170117_Gasto9_PIB_Prestaciones_NP = getPositionInArrayOfDate(datesArray_GRI_170117_Gasto9_PIB_Prestaciones_NP, lastRangeDate_GRI_170117_Gasto9_PIB_Prestaciones_NP) /* Slider-a tartekatuta dagoenean mainGraph-eko Y ardatzaren minimoa eta maximoak finkatzeko*/ var startGraphSerie_GRI_170117_Gasto9_PIB_Prestaciones_NP = getAllValuesY([s1_GRI_170117_Gasto9_PIB_Prestaciones_NP,s2_GRI_170117_Gasto9_PIB_Prestaciones_NP,s3_GRI_170117_Gasto9_PIB_Prestaciones_NP], minSliderPos_GRI_170117_Gasto9_PIB_Prestaciones_NP, maxSliderPos_GRI_170117_Gasto9_PIB_Prestaciones_NP) var minYMainGraph_GRI_170117_Gasto9_PIB_Prestaciones_NP = getSerieMin(startGraphSerie_GRI_170117_Gasto9_PIB_Prestaciones_NP) var maxYMainGraph_GRI_170117_Gasto9_PIB_Prestaciones_NP = getSerieMax(startGraphSerie_GRI_170117_Gasto9_PIB_Prestaciones_NP) /* Serie guztiak array bakar batean batzen dira maximoa eta minimoa kalkulatzeko */ var sliderGraphSerie_GRI_170117_Gasto9_PIB_Prestaciones_NP = getAllValuesY([s1_GRI_170117_Gasto9_PIB_Prestaciones_NP,s2_GRI_170117_Gasto9_PIB_Prestaciones_NP,s3_GRI_170117_Gasto9_PIB_Prestaciones_NP],minSlider_GRI_170117_Gasto9_PIB_Prestaciones_NP,maxSlider_GRI_170117_Gasto9_PIB_Prestaciones_NP)//getAllValues(s1_GRI_170117_Gasto9_PIB_Prestaciones_NP,s2_GRI_170117_Gasto9_PIB_Prestaciones_NP,s3_GRI_170117_Gasto9_PIB_Prestaciones_NP) var minYSliderGraph_GRI_170117_Gasto9_PIB_Prestaciones_NP = getSerieMin(sliderGraphSerie_GRI_170117_Gasto9_PIB_Prestaciones_NP) var maxYSliderGraph_GRI_170117_Gasto9_PIB_Prestaciones_NP = getSerieMax(sliderGraphSerie_GRI_170117_Gasto9_PIB_Prestaciones_NP) /* Hasierako grafikoa zentratuta dagoenean, jatorrizko serieen azpi-serieak hartzen ditu, zentratze-tartearen araberakoak*/ var s1_zentr_GRI_170117_Gasto9_PIB_Prestaciones_NP = new Array() var s2_zentr_GRI_170117_Gasto9_PIB_Prestaciones_NP = new Array() var s3_zentr_GRI_170117_Gasto9_PIB_Prestaciones_NP = new Array() var datesArray_zentr_GRI_170117_Gasto9_PIB_Prestaciones_NP = new Array() for(i=minSliderPos_GRI_170117_Gasto9_PIB_Prestaciones_NP;i<=maxSliderPos_GRI_170117_Gasto9_PIB_Prestaciones_NP;i++){ s1_zentr_GRI_170117_Gasto9_PIB_Prestaciones_NP.push(s1_GRI_170117_Gasto9_PIB_Prestaciones_NP[i]); s2_zentr_GRI_170117_Gasto9_PIB_Prestaciones_NP.push(s2_GRI_170117_Gasto9_PIB_Prestaciones_NP[i]); s3_zentr_GRI_170117_Gasto9_PIB_Prestaciones_NP.push(s3_GRI_170117_Gasto9_PIB_Prestaciones_NP[i]); datesArray_zentr_GRI_170117_Gasto9_PIB_Prestaciones_NP.push(s1_GRI_170117_Gasto9_PIB_Prestaciones_NP[i][0]) } /* Serieen kopiak x ardatzeko datu numerikoekin (zenbakiak daten ordez) */ s1_kopia_GRI_170117_Gasto9_PIB_Prestaciones_NP = changeSeries(s1_GRI_170117_Gasto9_PIB_Prestaciones_NP) s2_kopia_GRI_170117_Gasto9_PIB_Prestaciones_NP = changeSeries(s2_GRI_170117_Gasto9_PIB_Prestaciones_NP) s3_kopia_GRI_170117_Gasto9_PIB_Prestaciones_NP = changeSeries(s3_GRI_170117_Gasto9_PIB_Prestaciones_NP) s1_zentr_kopia_GRI_170117_Gasto9_PIB_Prestaciones_NP = changeSeries(s1_zentr_GRI_170117_Gasto9_PIB_Prestaciones_NP) s2_zentr_kopia_GRI_170117_Gasto9_PIB_Prestaciones_NP = changeSeries(s2_zentr_GRI_170117_Gasto9_PIB_Prestaciones_NP) s3_zentr_kopia_GRI_170117_Gasto9_PIB_Prestaciones_NP = changeSeries(s3_zentr_GRI_170117_Gasto9_PIB_Prestaciones_NP) s1_hidden_GRI_170117_Gasto9_PIB_Prestaciones_NP = new Array() for(i=0;i"; html_GRI_170117_Gasto9_PIB_Prestaciones_NP += "
"; html_GRI_170117_Gasto9_PIB_Prestaciones_NP += s_name_GRI_170117_Gasto9_PIB_Prestaciones_NP + ": "; html_GRI_170117_Gasto9_PIB_Prestaciones_NP += "" + number_format(value_GRI_170117_Gasto9_PIB_Prestaciones_NP,2) + ""; html_GRI_170117_Gasto9_PIB_Prestaciones_NP += ""; return html_GRI_170117_Gasto9_PIB_Prestaciones_NP; }, sizeAdjust: 8.5, //tooltipLocation : 'n' } }); function number_format(amount, decimals) { amount += ''; // por si pasan un numero en vez de un string amount = parseFloat(amount.replace(/[^0-9\.\-]/g, '')); // elimino cualquier cosa que no sea numero o punto decimals = decimals || 0; // por si la variable no fue fue pasada //if (amount % 1 != 0) decimals = 2; // si no es un numero o es igual a cero retorno el mismo cero if (isNaN(amount) || amount === 0) return parseFloat(0).toFixed(decimals); // si es mayor o menor que cero retorno el valor formateado como numero amount = '' + amount.toFixed(decimals); var amount_parts = amount.split('.'), regexp = /(\d+)(\d{3})/; while (regexp.test(amount_parts[0])) amount_parts[0] = amount_parts[0].replace(regexp, '$1' + '.' + '$2'); return amount_parts.join(','); } var clickSerie1_GRI_170117_Gasto9_PIB_Prestaciones_NP = true var clickSerie2_GRI_170117_Gasto9_PIB_Prestaciones_NP = true var clickSerie3_GRI_170117_Gasto9_PIB_Prestaciones_NP = true if (!document.getElementById("s1_checkbox_GRI_170117_Gasto9_PIB_Prestaciones_NP").checked) clickSerie1_GRI_170117_Gasto9_PIB_Prestaciones_NP = false; if (!document.getElementById("s2_checkbox_GRI_170117_Gasto9_PIB_Prestaciones_NP").checked) clickSerie2_GRI_170117_Gasto9_PIB_Prestaciones_NP = false; if (!document.getElementById("s3_checkbox_GRI_170117_Gasto9_PIB_Prestaciones_NP").checked) clickSerie3_GRI_170117_Gasto9_PIB_Prestaciones_NP = false; mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP.series[0].show = clickSerie1_GRI_170117_Gasto9_PIB_Prestaciones_NP; mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP.series[1].show = clickSerie2_GRI_170117_Gasto9_PIB_Prestaciones_NP; mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP.series[2].show = clickSerie3_GRI_170117_Gasto9_PIB_Prestaciones_NP; // Ezkutatuta dagoen seriea tooltipa ez agertzeko //mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP.series[4].show = false; /* Legend-a y ardatzeko canvas overlay-aren gainean ikusteko */ $.jqplot.postDrawHooks.push(function() { $(".jqplot-overlayCanvas-canvas").css('z-index', '0'); //send overlay canvas to back $(".jqplot-highlighter-tooltip").css('z-index', '1'); //make sure the tooltip is over the series }); /* Lehenengo serieari garrantzia emateko */ mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP.moveSeriesToFront(0) mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP.replot() /* Legendako serieak erakusteko/ez erakusteko */ var leftSliderPos_GRI_170117_Gasto9_PIB_Prestaciones_NP = minSliderPos_GRI_170117_Gasto9_PIB_Prestaciones_NP var rightSliderPos_GRI_170117_Gasto9_PIB_Prestaciones_NP = maxSliderPos_GRI_170117_Gasto9_PIB_Prestaciones_NP var minLegend_GRI_170117_Gasto9_PIB_Prestaciones_NP var maxLegend_GRI_170117_Gasto9_PIB_Prestaciones_NP var seriesStringAll_GRI_170117_Gasto9_PIB_Prestaciones_NP = ["s1","s2","s3"] var seriesStringActual_GRI_170117_Gasto9_PIB_Prestaciones_NP = ["s1","s2","s3"] var seriesAll_GRI_170117_Gasto9_PIB_Prestaciones_NP = [s1_GRI_170117_Gasto9_PIB_Prestaciones_NP,s2_GRI_170117_Gasto9_PIB_Prestaciones_NP,s3_GRI_170117_Gasto9_PIB_Prestaciones_NP] var seriesActual_GRI_170117_Gasto9_PIB_Prestaciones_NP; seriesStringActual_GRI_170117_Gasto9_PIB_Prestaciones_NP = getSeriesClickedOnLegend(this, seriesStringActual_GRI_170117_Gasto9_PIB_Prestaciones_NP, seriesStringAll_GRI_170117_Gasto9_PIB_Prestaciones_NP, mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP) seriesActual_GRI_170117_Gasto9_PIB_Prestaciones_NP = getSeriesFromString(seriesStringActual_GRI_170117_Gasto9_PIB_Prestaciones_NP, seriesAll_GRI_170117_Gasto9_PIB_Prestaciones_NP) if(seriesActual_GRI_170117_Gasto9_PIB_Prestaciones_NP.length>0){ allSeries_GRI_170117_Gasto9_PIB_Prestaciones_NP = getAllValuesY(seriesActual_GRI_170117_Gasto9_PIB_Prestaciones_NP,leftSliderPos_GRI_170117_Gasto9_PIB_Prestaciones_NP,rightSliderPos_GRI_170117_Gasto9_PIB_Prestaciones_NP) minLegend_GRI_170117_Gasto9_PIB_Prestaciones_NP = getSerieMin(allSeries_GRI_170117_Gasto9_PIB_Prestaciones_NP) maxLegend_GRI_170117_Gasto9_PIB_Prestaciones_NP = getSerieMax(allSeries_GRI_170117_Gasto9_PIB_Prestaciones_NP) } else{ minLegend_GRI_170117_Gasto9_PIB_Prestaciones_NP=-20 maxLegend_GRI_170117_Gasto9_PIB_Prestaciones_NP=20 } var seriesWidth_GRI_170117_Gasto9_PIB_Prestaciones_NP = [1, 1, 1] $("input[type=checkbox]").click(function(){ if(this.id == "s1_checkbox_GRI_170117_Gasto9_PIB_Prestaciones_NP") clickSerie1_GRI_170117_Gasto9_PIB_Prestaciones_NP = this.checked else if(this.id == "s2_checkbox_GRI_170117_Gasto9_PIB_Prestaciones_NP") clickSerie2_GRI_170117_Gasto9_PIB_Prestaciones_NP = this.checked else if(this.id == "s3_checkbox_GRI_170117_Gasto9_PIB_Prestaciones_NP") clickSerie3_GRI_170117_Gasto9_PIB_Prestaciones_NP = this.checked // Ezkutatuta dagoen seriea tooltipa ez agertzeko mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP.series[3].show = false; mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP.series[0].show = clickSerie1_GRI_170117_Gasto9_PIB_Prestaciones_NP mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP.series[1].show = clickSerie2_GRI_170117_Gasto9_PIB_Prestaciones_NP mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP.series[2].show = clickSerie3_GRI_170117_Gasto9_PIB_Prestaciones_NP seriesStringActual_GRI_170117_Gasto9_PIB_Prestaciones_NP = getSeriesClickedOnLegend(this, seriesStringActual_GRI_170117_Gasto9_PIB_Prestaciones_NP, seriesStringAll_GRI_170117_Gasto9_PIB_Prestaciones_NP, mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP) seriesActual_GRI_170117_Gasto9_PIB_Prestaciones_NP = getSeriesFromString(seriesStringActual_GRI_170117_Gasto9_PIB_Prestaciones_NP, seriesAll_GRI_170117_Gasto9_PIB_Prestaciones_NP) if(seriesActual_GRI_170117_Gasto9_PIB_Prestaciones_NP.length>0){ allSeries_GRI_170117_Gasto9_PIB_Prestaciones_NP = getAllValuesY(seriesActual_GRI_170117_Gasto9_PIB_Prestaciones_NP,leftSliderPos_GRI_170117_Gasto9_PIB_Prestaciones_NP,rightSliderPos_GRI_170117_Gasto9_PIB_Prestaciones_NP) minLegend_GRI_170117_Gasto9_PIB_Prestaciones_NP = getSerieMin(allSeries_GRI_170117_Gasto9_PIB_Prestaciones_NP) maxLegend_GRI_170117_Gasto9_PIB_Prestaciones_NP = getSerieMax(allSeries_GRI_170117_Gasto9_PIB_Prestaciones_NP) } else{ minLegend_GRI_170117_Gasto9_PIB_Prestaciones_NP=-20 maxLegend_GRI_170117_Gasto9_PIB_Prestaciones_NP=20 } mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP.axes.yaxis.ticks = getYRange(minLegend_GRI_170117_Gasto9_PIB_Prestaciones_NP, maxLegend_GRI_170117_Gasto9_PIB_Prestaciones_NP) mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP.axes.y2axis.ticks = getYRange(minLegend_GRI_170117_Gasto9_PIB_Prestaciones_NP, maxLegend_GRI_170117_Gasto9_PIB_Prestaciones_NP) mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP.replot() }); $("p").mouseenter(function() { // Ezkutatuta dagoen seriea tooltipa ez agertzeko mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP.series[3].show = false; elementId_GRI_170117_Gasto9_PIB_Prestaciones_NP = this.id clicks_GRI_170117_Gasto9_PIB_Prestaciones_NP = [clickSerie1_GRI_170117_Gasto9_PIB_Prestaciones_NP,clickSerie2_GRI_170117_Gasto9_PIB_Prestaciones_NP,clickSerie3_GRI_170117_Gasto9_PIB_Prestaciones_NP] if(elementId_GRI_170117_Gasto9_PIB_Prestaciones_NP == "serie1Name_GRI_170117_Gasto9_PIB_Prestaciones_NP" && clickSerie1_GRI_170117_Gasto9_PIB_Prestaciones_NP == true){ series_GRI_170117_Gasto9_PIB_Prestaciones_NP = repaintLineWidth(elementId_GRI_170117_Gasto9_PIB_Prestaciones_NP, "enter", mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP, clicks_GRI_170117_Gasto9_PIB_Prestaciones_NP, seriesWidth_GRI_170117_Gasto9_PIB_Prestaciones_NP) mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP.replot({series:series_GRI_170117_Gasto9_PIB_Prestaciones_NP}) mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP.moveSeriesToFront(0) } else if(elementId_GRI_170117_Gasto9_PIB_Prestaciones_NP == "serie2Name_GRI_170117_Gasto9_PIB_Prestaciones_NP" && clickSerie2_GRI_170117_Gasto9_PIB_Prestaciones_NP == true){ series_GRI_170117_Gasto9_PIB_Prestaciones_NP = repaintLineWidth(elementId_GRI_170117_Gasto9_PIB_Prestaciones_NP, "enter", mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP, clicks_GRI_170117_Gasto9_PIB_Prestaciones_NP, seriesWidth_GRI_170117_Gasto9_PIB_Prestaciones_NP) mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP.replot({series:series_GRI_170117_Gasto9_PIB_Prestaciones_NP}) mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP.moveSeriesToFront(1) } else if(elementId_GRI_170117_Gasto9_PIB_Prestaciones_NP == "serie3Name_GRI_170117_Gasto9_PIB_Prestaciones_NP" && clickSerie3_GRI_170117_Gasto9_PIB_Prestaciones_NP == true){ series_GRI_170117_Gasto9_PIB_Prestaciones_NP = repaintLineWidth(elementId_GRI_170117_Gasto9_PIB_Prestaciones_NP, "enter", mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP, clicks_GRI_170117_Gasto9_PIB_Prestaciones_NP, seriesWidth_GRI_170117_Gasto9_PIB_Prestaciones_NP) mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP.replot({series:series_GRI_170117_Gasto9_PIB_Prestaciones_NP}) mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP.moveSeriesToFront(2) } seriesStringActual_GRI_170117_Gasto9_PIB_Prestaciones_NP = getSeriesClickedOnLegend(this, seriesStringActual_GRI_170117_Gasto9_PIB_Prestaciones_NP, seriesStringAll_GRI_170117_Gasto9_PIB_Prestaciones_NP, mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP) seriesActual_GRI_170117_Gasto9_PIB_Prestaciones_NP = getSeriesFromString(seriesStringActual_GRI_170117_Gasto9_PIB_Prestaciones_NP, seriesAll_GRI_170117_Gasto9_PIB_Prestaciones_NP) if(seriesActual_GRI_170117_Gasto9_PIB_Prestaciones_NP.length>0){ allSeries_GRI_170117_Gasto9_PIB_Prestaciones_NP = getAllValuesY(seriesActual_GRI_170117_Gasto9_PIB_Prestaciones_NP,leftSliderPos_GRI_170117_Gasto9_PIB_Prestaciones_NP,rightSliderPos_GRI_170117_Gasto9_PIB_Prestaciones_NP) minLegend_GRI_170117_Gasto9_PIB_Prestaciones_NP = getSerieMin(allSeries_GRI_170117_Gasto9_PIB_Prestaciones_NP) maxLegend_GRI_170117_Gasto9_PIB_Prestaciones_NP = getSerieMax(allSeries_GRI_170117_Gasto9_PIB_Prestaciones_NP) } else{ minLegend_GRI_170117_Gasto9_PIB_Prestaciones_NP=-20 maxLegend_GRI_170117_Gasto9_PIB_Prestaciones_NP=20 } mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP.axes.yaxis.ticks = getYRange(minLegend_GRI_170117_Gasto9_PIB_Prestaciones_NP, maxLegend_GRI_170117_Gasto9_PIB_Prestaciones_NP) mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP.axes.y2axis.ticks = getYRange(minLegend_GRI_170117_Gasto9_PIB_Prestaciones_NP, maxLegend_GRI_170117_Gasto9_PIB_Prestaciones_NP) mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP.series[0].show = clickSerie1_GRI_170117_Gasto9_PIB_Prestaciones_NP mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP.series[1].show = clickSerie2_GRI_170117_Gasto9_PIB_Prestaciones_NP mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP.series[2].show = clickSerie3_GRI_170117_Gasto9_PIB_Prestaciones_NP mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP.replot() }) $("p").mouseleave(function() { // Ezkutatuta dagoen seriea tooltipa ez agertzeko mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP.series[3].show = false; elementId_GRI_170117_Gasto9_PIB_Prestaciones_NP = this.id clicks_GRI_170117_Gasto9_PIB_Prestaciones_NP = [clickSerie1_GRI_170117_Gasto9_PIB_Prestaciones_NP,clickSerie2_GRI_170117_Gasto9_PIB_Prestaciones_NP,clickSerie3_GRI_170117_Gasto9_PIB_Prestaciones_NP] if(elementId_GRI_170117_Gasto9_PIB_Prestaciones_NP == "serie1Name_GRI_170117_Gasto9_PIB_Prestaciones_NP" && clickSerie1_GRI_170117_Gasto9_PIB_Prestaciones_NP == true){ series_GRI_170117_Gasto9_PIB_Prestaciones_NP = repaintLineWidth(elementId_GRI_170117_Gasto9_PIB_Prestaciones_NP, "exit", mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP, clicks_GRI_170117_Gasto9_PIB_Prestaciones_NP, seriesWidth_GRI_170117_Gasto9_PIB_Prestaciones_NP) mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP.replot({series:series_GRI_170117_Gasto9_PIB_Prestaciones_NP}) } else if(elementId_GRI_170117_Gasto9_PIB_Prestaciones_NP == "serie2Name_GRI_170117_Gasto9_PIB_Prestaciones_NP" && clickSerie2_GRI_170117_Gasto9_PIB_Prestaciones_NP == true){ series_GRI_170117_Gasto9_PIB_Prestaciones_NP = repaintLineWidth(elementId_GRI_170117_Gasto9_PIB_Prestaciones_NP, "exit", mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP, clicks_GRI_170117_Gasto9_PIB_Prestaciones_NP, seriesWidth_GRI_170117_Gasto9_PIB_Prestaciones_NP) mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP.replot({series:series_GRI_170117_Gasto9_PIB_Prestaciones_NP}) } else if(elementId_GRI_170117_Gasto9_PIB_Prestaciones_NP == "serie3Name_GRI_170117_Gasto9_PIB_Prestaciones_NP" && clickSerie3_GRI_170117_Gasto9_PIB_Prestaciones_NP == true){ series_GRI_170117_Gasto9_PIB_Prestaciones_NP = repaintLineWidth(elementId_GRI_170117_Gasto9_PIB_Prestaciones_NP, "exit", mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP, clicks_GRI_170117_Gasto9_PIB_Prestaciones_NP, seriesWidth_GRI_170117_Gasto9_PIB_Prestaciones_NP) mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP.replot({series:series_GRI_170117_Gasto9_PIB_Prestaciones_NP}) } mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP.axes.yaxis.ticks = getYRange(minLegend_GRI_170117_Gasto9_PIB_Prestaciones_NP, maxLegend_GRI_170117_Gasto9_PIB_Prestaciones_NP) mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP.axes.y2axis.ticks = getYRange(minLegend_GRI_170117_Gasto9_PIB_Prestaciones_NP, maxLegend_GRI_170117_Gasto9_PIB_Prestaciones_NP) mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP.series[0].show = clickSerie1_GRI_170117_Gasto9_PIB_Prestaciones_NP mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP.series[1].show = clickSerie2_GRI_170117_Gasto9_PIB_Prestaciones_NP mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP.series[2].show = clickSerie3_GRI_170117_Gasto9_PIB_Prestaciones_NP /* Lehenengo serieari garrantzia emateko */ mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP.moveSeriesToFront(0) mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP.replot() }) /* Slider-aren grafikoa marraztu */ var sliderChart_GRI_170117_Gasto9_PIB_Prestaciones_NP = $.jqplot ('chart2_GRI_170117_Gasto9_PIB_Prestaciones_NP', [s1_kopia_GRI_170117_Gasto9_PIB_Prestaciones_NP,s2_kopia_GRI_170117_Gasto9_PIB_Prestaciones_NP,s3_kopia_GRI_170117_Gasto9_PIB_Prestaciones_NP], { grid: { background: 'white', drawBorder: false, shadow: false, }, seriesColors: ["#0000FF", "#FFA500", "#008000"], series:[ {label:serieNames_GRI_170117_Gasto9_PIB_Prestaciones_NP[0],renderer:$.jqplot.LineRenderer,color: "#0000FF",lineWidth: 1,rendererOptions:{smooth:true},pointLabels:{show:false},markerOptions:{size:0}}, {label:serieNames_GRI_170117_Gasto9_PIB_Prestaciones_NP[1],renderer:$.jqplot.LineRenderer,color: "#FFA500",lineWidth: 1,rendererOptions:{smooth:true},pointLabels:{show:false},markerOptions:{size:0}}, {label:serieNames_GRI_170117_Gasto9_PIB_Prestaciones_NP[2],renderer:$.jqplot.LineRenderer,color: "#008000",lineWidth: 1,rendererOptions:{smooth:true},pointLabels:{show:false},markerOptions:{size:0}}, ], axesDefaults: { labelRenderer: $.jqplot.CanvasAxisLabelRenderer }, axes: { xaxis: { //tickRenderer: $.jqplot.CanvasAxisTickRenderer, tickOptions: { formatter: function (format, val) { tickName_GRI_170117_Gasto9_PIB_Prestaciones_NP = formatTickLabelSlider(val, s1_kopia_GRI_170117_Gasto9_PIB_Prestaciones_NP[0][0], s1_kopia_GRI_170117_Gasto9_PIB_Prestaciones_NP[s1_kopia_GRI_170117_Gasto9_PIB_Prestaciones_NP.length-1][0], s1_GRI_170117_Gasto9_PIB_Prestaciones_NP, language, "yearly_data") return tickName_GRI_170117_Gasto9_PIB_Prestaciones_NP }, textColor: 'black' }, ticks : getXRangeSlider(s1_kopia_GRI_170117_Gasto9_PIB_Prestaciones_NP[0][0], s1_kopia_GRI_170117_Gasto9_PIB_Prestaciones_NP[s1_kopia_GRI_170117_Gasto9_PIB_Prestaciones_NP.length-1][0]), drawMajorGridlines: true, drawMinorGridlines: true }, yaxis: { rendererOptions: {forceTickAt0: true}, tickOptions: {formatString: "%'i" }, showTicks: false, min: minYSliderGraph_GRI_170117_Gasto9_PIB_Prestaciones_NP - yAddedQuantity_GRI_170117_Gasto9_PIB_Prestaciones_NP, max:maxYSliderGraph_GRI_170117_Gasto9_PIB_Prestaciones_NP + yAddedQuantity_GRI_170117_Gasto9_PIB_Prestaciones_NP } } }); /* SliderChart-eko hasierako laukizuzenak marrazteko*/ sliderChart_GRI_170117_Gasto9_PIB_Prestaciones_NP.replot({ canvasOverlay: { show: true, objects: [ { rectangle: { xmin:0,xmax: minSliderPos_GRI_170117_Gasto9_PIB_Prestaciones_NP, xminOffset: "0px", xmaxOffset: "0px", yminOffset: "0px", ymaxOffset: "0px", color: "rgba(192,192,192,0.5)"} }, { rectangle: { xmin:maxSliderPos_GRI_170117_Gasto9_PIB_Prestaciones_NP,xmax: s1_kopia_GRI_170117_Gasto9_PIB_Prestaciones_NP[s1_kopia_GRI_170117_Gasto9_PIB_Prestaciones_NP.length - 1][0], xminOffset: "0px", xmaxOffset: "0px", yminOffset: "0px", ymaxOffset: "0px", color: "rgba(192,192,192,0.5)"} } ] } }) sliderChart_GRI_170117_Gasto9_PIB_Prestaciones_NP.moveSeriesToFront(0) /* Slider-a marraztu */ $("#slider_GRI_170117_Gasto9_PIB_Prestaciones_NP").slider({ max: maxSlider_GRI_170117_Gasto9_PIB_Prestaciones_NP, min: minSlider_GRI_170117_Gasto9_PIB_Prestaciones_NP, range: true, values: [ minSliderPos_GRI_170117_Gasto9_PIB_Prestaciones_NP, maxSliderPos_GRI_170117_Gasto9_PIB_Prestaciones_NP ], slide: function(event,ui){ var serie1New_GRI_170117_Gasto9_PIB_Prestaciones_NP = new Array() var serie2New_GRI_170117_Gasto9_PIB_Prestaciones_NP = new Array() var serie3New_GRI_170117_Gasto9_PIB_Prestaciones_NP= new Array() var datesArrayBerria_GRI_170117_Gasto9_PIB_Prestaciones_NP = new Array() for(i=ui.values[0];i<=ui.values[1];i++) { serie1New_GRI_170117_Gasto9_PIB_Prestaciones_NP.push(s1_GRI_170117_Gasto9_PIB_Prestaciones_NP[i]); serie2New_GRI_170117_Gasto9_PIB_Prestaciones_NP.push(s2_GRI_170117_Gasto9_PIB_Prestaciones_NP[i]); serie3New_GRI_170117_Gasto9_PIB_Prestaciones_NP.push(s3_GRI_170117_Gasto9_PIB_Prestaciones_NP[i]); datesArrayBerria_GRI_170117_Gasto9_PIB_Prestaciones_NP.push(s1_GRI_170117_Gasto9_PIB_Prestaciones_NP[i][0]) } var valuesNew_GRI_170117_Gasto9_PIB_Prestaciones_NP = getAllValuesY([serie1New_GRI_170117_Gasto9_PIB_Prestaciones_NP, serie2New_GRI_170117_Gasto9_PIB_Prestaciones_NP, serie3New_GRI_170117_Gasto9_PIB_Prestaciones_NP],0,serie1New_GRI_170117_Gasto9_PIB_Prestaciones_NP.length-1) min_GRI_170117_Gasto9_PIB_Prestaciones_NP = getSerieMin(valuesNew_GRI_170117_Gasto9_PIB_Prestaciones_NP) max_GRI_170117_Gasto9_PIB_Prestaciones_NP = getSerieMax(valuesNew_GRI_170117_Gasto9_PIB_Prestaciones_NP) serieBerria1_GRI_170117_Gasto9_PIB_Prestaciones_NP = changeSeries(serie1New_GRI_170117_Gasto9_PIB_Prestaciones_NP) serieBerria2_GRI_170117_Gasto9_PIB_Prestaciones_NP = changeSeries(serie2New_GRI_170117_Gasto9_PIB_Prestaciones_NP) serieBerria3_GRI_170117_Gasto9_PIB_Prestaciones_NP = changeSeries(serie3New_GRI_170117_Gasto9_PIB_Prestaciones_NP) mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP.destroy() mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP = $.jqplot ('chart1_GRI_170117_Gasto9_PIB_Prestaciones_NP', [serieBerria1_GRI_170117_Gasto9_PIB_Prestaciones_NP,serieBerria2_GRI_170117_Gasto9_PIB_Prestaciones_NP,serieBerria3_GRI_170117_Gasto9_PIB_Prestaciones_NP,s1_hidden_GRI_170117_Gasto9_PIB_Prestaciones_NP], { grid: { background: 'white', drawBorder: false, shadow: false, }, canvasOverlay: { show: true, objects: [ { horizontalLine:{ y: 0, xminOffset: "0px", xmaxOffset: "0px", lineWidth: 1, color: "black", shadow: false, name: "0" } } ] }, seriesColors: ["#0000FF", "#FFA500", "#008000", "black"], series:[ {label:serieNames_GRI_170117_Gasto9_PIB_Prestaciones_NP[0],show:document.getElementById("s1_checkbox_GRI_170117_Gasto9_PIB_Prestaciones_NP").checked,renderer:$.jqplot.LineRenderer,color:"#0000FF",lineWidth:1,rendererOptions:{smooth:true},pointLabels:{show:false},markerOptions:{size:0}}, {label:serieNames_GRI_170117_Gasto9_PIB_Prestaciones_NP[1],show:document.getElementById("s2_checkbox_GRI_170117_Gasto9_PIB_Prestaciones_NP").checked,renderer:$.jqplot.LineRenderer,color:"#FFA500",lineWidth:1,rendererOptions:{smooth:true},pointLabels:{show:false},markerOptions:{size:0}}, {label:serieNames_GRI_170117_Gasto9_PIB_Prestaciones_NP[2],show:document.getElementById("s3_checkbox_GRI_170117_Gasto9_PIB_Prestaciones_NP").checked,renderer:$.jqplot.LineRenderer,color:"#008000",lineWidth:1,rendererOptions:{smooth:true},pointLabels:{show:false},markerOptions:{size:0}}, {yaxis:"y2axis",renderer:$.jqplot.LineRenderer,color:"#008000"} ], axesDefaults: { labelRenderer: $.jqplot.CanvasAxisLabelRenderer }, axes: { xaxis: { //tickRenderer: $.jqplot.CanvasAxisTickRenderer, tickOptions: { formatter: function (format, val) { tickName_GRI_170117_Gasto9_PIB_Prestaciones_NP = formatTickLabel(val, serieBerria1_GRI_170117_Gasto9_PIB_Prestaciones_NP[0][0], serieBerria1_GRI_170117_Gasto9_PIB_Prestaciones_NP[serieBerria1_GRI_170117_Gasto9_PIB_Prestaciones_NP.length-1][0], serie1New_GRI_170117_Gasto9_PIB_Prestaciones_NP, language, "yearly_data") return tickName_GRI_170117_Gasto9_PIB_Prestaciones_NP }, textColor: 'black' }, ticks : getXRange(serieBerria1_GRI_170117_Gasto9_PIB_Prestaciones_NP[0][0], serieBerria1_GRI_170117_Gasto9_PIB_Prestaciones_NP[serieBerria1_GRI_170117_Gasto9_PIB_Prestaciones_NP.length-1][0]), drawMajorGridlines: true }, yaxis: { tickOptions: {formatString: "%'i" }, ticks:getYRange(min_GRI_170117_Gasto9_PIB_Prestaciones_NP, max_GRI_170117_Gasto9_PIB_Prestaciones_NP) }, y2axis: { rendererOptions: {alignTicks: true}, tickOptions: {formatString: "%'i" }, ticks:getYRange(min_GRI_170117_Gasto9_PIB_Prestaciones_NP, max_GRI_170117_Gasto9_PIB_Prestaciones_NP) } }, highlighter: { show: true, tooltipContentEditor: function (str, seriesIndex, pointIndex, plot) { var date_GRI_170117_Gasto9_PIB_Prestaciones_NP = datesArrayBerria_GRI_170117_Gasto9_PIB_Prestaciones_NP[plot.data[seriesIndex][pointIndex][0]]; var s_name_GRI_170117_Gasto9_PIB_Prestaciones_NP = plot.series[seriesIndex]["label"]; num_GRI_170117_Gasto9_PIB_Prestaciones_NP = plot.data[seriesIndex][pointIndex][1] var value_GRI_170117_Gasto9_PIB_Prestaciones_NP = num_GRI_170117_Gasto9_PIB_Prestaciones_NP//plot.data[seriesIndex][pointIndex][1]; var yearString_GRI_170117_Gasto9_PIB_Prestaciones_NP = date_GRI_170117_Gasto9_PIB_Prestaciones_NP.substring(6,10); var monthString_GRI_170117_Gasto9_PIB_Prestaciones_NP = date_GRI_170117_Gasto9_PIB_Prestaciones_NP.substring(3,5); if ("yearly_data"==="yearly_data") { monthName_GRI_170117_Gasto9_PIB_Prestaciones_NP = ""; } else if ("quarterly_data"==="yearly_data") { monthName_GRI_170117_Gasto9_PIB_Prestaciones_NP = getQuarter(monthString_GRI_170117_Gasto9_PIB_Prestaciones_NP, language) + ", "; } else { monthName_GRI_170117_Gasto9_PIB_Prestaciones_NP = getMonthHighlight(monthString_GRI_170117_Gasto9_PIB_Prestaciones_NP, language) + ", "; } var html_GRI_170117_Gasto9_PIB_Prestaciones_NP = "
"; html_GRI_170117_Gasto9_PIB_Prestaciones_NP += "" + monthName_GRI_170117_Gasto9_PIB_Prestaciones_NP + yearString_GRI_170117_Gasto9_PIB_Prestaciones_NP + ""; html_GRI_170117_Gasto9_PIB_Prestaciones_NP += "
"; html_GRI_170117_Gasto9_PIB_Prestaciones_NP += s_name_GRI_170117_Gasto9_PIB_Prestaciones_NP + ": "; html_GRI_170117_Gasto9_PIB_Prestaciones_NP += "" + number_format(value_GRI_170117_Gasto9_PIB_Prestaciones_NP, 2) + ""; html_GRI_170117_Gasto9_PIB_Prestaciones_NP += "
"; return html_GRI_170117_Gasto9_PIB_Prestaciones_NP; }, sizeAdjust: 8.5, //tooltipLocation : 'n' } }); // Ezkutatuta dagoen seriea tooltipa ez agertzeko mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP.series[3].show = false; /* Line-chart-ari dagokion lehenengo serieari garrantzia emateko */ mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP.moveSeriesToFront(0) /* SliderChart-eko momentuko laukizuzenak marrazteko*/ sliderChart_GRI_170117_Gasto9_PIB_Prestaciones_NP.replot({ canvasOverlay: { show: true, objects: [ { rectangle: { xmin:0,xmax: ui.values[0], xminOffset: "0px", xmaxOffset: "0px", yminOffset: "0px", ymaxOffset: "0px", color: "rgba(192,192,192,0.5)"} }, { rectangle: { xmin:ui.values[1],xmax: s1_kopia_GRI_170117_Gasto9_PIB_Prestaciones_NP[s1_kopia_GRI_170117_Gasto9_PIB_Prestaciones_NP.length - 1][0], xminOffset: "0px", xmaxOffset: "0px", yminOffset: "0px", ymaxOffset: "0px", color: "rgba(192,192,192,0.5)"} } ] } }) sliderChart_GRI_170117_Gasto9_PIB_Prestaciones_NP.moveSeriesToFront(0) /* Legendan klikatuta dauden serieen maximo eta minimoa eguneratzeko*/ leftSliderPos_GRI_170117_Gasto9_PIB_Prestaciones_NP = ui.values[0] rightSliderPos_GRI_170117_Gasto9_PIB_Prestaciones_NP = ui.values[1] seriesStringActual_GRI_170117_Gasto9_PIB_Prestaciones_NP = getSeriesClickedOnLegend(this, seriesStringActual_GRI_170117_Gasto9_PIB_Prestaciones_NP, seriesStringAll_GRI_170117_Gasto9_PIB_Prestaciones_NP, mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP) seriesActual_GRI_170117_Gasto9_PIB_Prestaciones_NP = getSeriesFromString(seriesStringActual_GRI_170117_Gasto9_PIB_Prestaciones_NP, seriesAll_GRI_170117_Gasto9_PIB_Prestaciones_NP) allSeries_GRI_170117_Gasto9_PIB_Prestaciones_NP = getAllValuesY(seriesActual_GRI_170117_Gasto9_PIB_Prestaciones_NP,leftSliderPos_GRI_170117_Gasto9_PIB_Prestaciones_NP,rightSliderPos_GRI_170117_Gasto9_PIB_Prestaciones_NP) minLegend_GRI_170117_Gasto9_PIB_Prestaciones_NP = getSerieMin(allSeries_GRI_170117_Gasto9_PIB_Prestaciones_NP) maxLegend_GRI_170117_Gasto9_PIB_Prestaciones_NP = getSerieMax(allSeries_GRI_170117_Gasto9_PIB_Prestaciones_NP) mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP.axes.yaxis.ticks = getYRange(minLegend_GRI_170117_Gasto9_PIB_Prestaciones_NP, maxLegend_GRI_170117_Gasto9_PIB_Prestaciones_NP) mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP.axes.y2axis.ticks = getYRange(minLegend_GRI_170117_Gasto9_PIB_Prestaciones_NP, maxLegend_GRI_170117_Gasto9_PIB_Prestaciones_NP) mainChart_GRI_170117_Gasto9_PIB_Prestaciones_NP.replot(); } }); /* */ function repaintLineWidth(serieId, eventType, mainChart, clicks, seriesWidth){ var series_GRI_170117_Gasto9_PIB_Prestaciones_NP; if (serieId == "serie1Name_GRI_170117_Gasto9_PIB_Prestaciones_NP" && eventType == "enter"){ if(clicks[0] == true) seriesWidth[0] = seriesWidth[0] + 1 document.getElementById(serieId).setAttribute("style", "background: rgba(192,192,192,0.5); border-style:solid; border-width:1px; border-color:black; font-family: Verdana !important; font-size: 18px; font-style: italic; font-weight: normal;"); } else if (serieId == "serie1Name_GRI_170117_Gasto9_PIB_Prestaciones_NP" && eventType == "exit"){ if(clicks[0] == true) seriesWidth[0] = seriesWidth[0] -1 document.getElementById(serieId).setAttribute("style", "font-family: Verdana !important; font-size: 18px; font-style: italic; font-weight: normal;"); } if (serieId == "serie2Name_GRI_170117_Gasto9_PIB_Prestaciones_NP" && eventType == "enter"){ if(clicks[1] == true)seriesWidth[1] = seriesWidth[1] + 1 document.getElementById(serieId).setAttribute("style", "background: rgba(192,192,192,0.5); border-style:solid; border-width:1px; border-color:black; font-family: Verdana !important; font-size: 18px; font-style: italic; font-weight: normal;"); } else if (serieId == "serie2Name_GRI_170117_Gasto9_PIB_Prestaciones_NP" && eventType == "exit"){ if(clicks[1] == true)seriesWidth[1] = seriesWidth[1] - 1 document.getElementById(serieId).setAttribute("style", "font-family: Verdana !important; font-size: 18px; font-style: italic; font-weight: normal;"); } if (serieId == "serie3Name_GRI_170117_Gasto9_PIB_Prestaciones_NP" && eventType == "enter"){ if(clicks[2] == true)seriesWidth[2] = seriesWidth[2] + 1 document.getElementById(serieId).setAttribute("style", "background: rgba(192,192,192,0.5); border-style:solid; border-width:1px; border-color:black; font-family: Verdana !important; font-size: 18px; font-style: italic; font-weight: normal;"); } else if (serieId == "serie3Name_GRI_170117_Gasto9_PIB_Prestaciones_NP" && eventType == "exit"){ if(clicks[2] == true)seriesWidth[2] = seriesWidth[2] - 1 document.getElementById(serieId).setAttribute("style", "font-family: Verdana !important; font-size: 18px; font-style: italic; font-weight: normal;"); } series_GRI_170117_Gasto9_PIB_Prestaciones_NP = [{lineWidth: seriesWidth[0]},{lineWidth: seriesWidth[1]},{lineWidth: seriesWidth[2]},{lineWidth: 0.01}] return series_GRI_170117_Gasto9_PIB_Prestaciones_NP; } /* Funtzio honek Legend-an klikaturik dauden serieen array-a itzultzen du eta seriea pintatu/ez pintatu */ function getSeriesClickedOnLegend(thisClicked, seriesActual, seriesAll, mainChart){ result_GRI_170117_Gasto9_PIB_Prestaciones_NP = seriesActual if(thisClicked.value=="s1_legend_GRI_170117_Gasto9_PIB_Prestaciones_NP"){ index = indexOfSerieClicked(thisClicked.value, seriesActual) if(thisClicked.checked == true){ result_GRI_170117_Gasto9_PIB_Prestaciones_NP.splice(index, 0, seriesAll[0]); } else{ result_GRI_170117_Gasto9_PIB_Prestaciones_NP.splice(index, 1); } mainChart.series[0].show = thisClicked.checked; } if(thisClicked.value=="s2_legend_GRI_170117_Gasto9_PIB_Prestaciones_NP"){ index = indexOfSerieClicked(thisClicked.value, seriesActual) if(thisClicked.checked == true){ result_GRI_170117_Gasto9_PIB_Prestaciones_NP.splice(index, 0, seriesAll[1]); } else{ result_GRI_170117_Gasto9_PIB_Prestaciones_NP.splice(index, 1); } mainChart.series[1].show = thisClicked.checked; } if(thisClicked.value=="s3_legend_GRI_170117_Gasto9_PIB_Prestaciones_NP"){ index = indexOfSerieClicked(thisClicked.value, seriesActual) if(thisClicked.checked == true){ result_GRI_170117_Gasto9_PIB_Prestaciones_NP.splice(index, 0, seriesAll[2]); } else{ result_GRI_170117_Gasto9_PIB_Prestaciones_NP.splice(index, 1); } mainChart.series[2].show = thisClicked.checked; } return result_GRI_170117_Gasto9_PIB_Prestaciones_NP } });