";
html_GRI_EDEF_TasaTH += "
";
html_GRI_EDEF_TasaTH += s_name_GRI_EDEF_TasaTH + ": ";
html_GRI_EDEF_TasaTH += "" + number_format(value_GRI_EDEF_TasaTH,1) + "";
html_GRI_EDEF_TasaTH += "";
return html_GRI_EDEF_TasaTH;
},
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_EDEF_TasaTH = true
var clickSerie2_GRI_EDEF_TasaTH = true
var clickSerie3_GRI_EDEF_TasaTH = true
var clickSerie4_GRI_EDEF_TasaTH = true
if (!document.getElementById("s1_checkbox_GRI_EDEF_TasaTH").checked) clickSerie1_GRI_EDEF_TasaTH = false;
if (!document.getElementById("s2_checkbox_GRI_EDEF_TasaTH").checked) clickSerie2_GRI_EDEF_TasaTH = false;
if (!document.getElementById("s3_checkbox_GRI_EDEF_TasaTH").checked) clickSerie3_GRI_EDEF_TasaTH = false;
if (!document.getElementById("s4_checkbox_GRI_EDEF_TasaTH").checked) clickSerie4_GRI_EDEF_TasaTH = false;
mainChart_GRI_EDEF_TasaTH.series[0].show = clickSerie1_GRI_EDEF_TasaTH;
mainChart_GRI_EDEF_TasaTH.series[1].show = clickSerie2_GRI_EDEF_TasaTH;
mainChart_GRI_EDEF_TasaTH.series[2].show = clickSerie3_GRI_EDEF_TasaTH;
mainChart_GRI_EDEF_TasaTH.series[3].show = clickSerie4_GRI_EDEF_TasaTH;
// Ezkutatuta dagoen seriea tooltipa ez agertzeko
//mainChart_GRI_EDEF_TasaTH.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_EDEF_TasaTH.moveSeriesToFront(0)
mainChart_GRI_EDEF_TasaTH.replot()
/* Legendako serieak erakusteko/ez erakusteko */
var leftSliderPos_GRI_EDEF_TasaTH = minSliderPos_GRI_EDEF_TasaTH
var rightSliderPos_GRI_EDEF_TasaTH = maxSliderPos_GRI_EDEF_TasaTH
var minLegend_GRI_EDEF_TasaTH
var maxLegend_GRI_EDEF_TasaTH
var seriesStringAll_GRI_EDEF_TasaTH = ["s1","s2","s3","s4"]
var seriesStringActual_GRI_EDEF_TasaTH = ["s1","s2","s3","s4"]
var seriesAll_GRI_EDEF_TasaTH = [s1_GRI_EDEF_TasaTH,s2_GRI_EDEF_TasaTH,s3_GRI_EDEF_TasaTH,s4_GRI_EDEF_TasaTH]
var seriesActual_GRI_EDEF_TasaTH;
seriesStringActual_GRI_EDEF_TasaTH = getSeriesClickedOnLegend(this, seriesStringActual_GRI_EDEF_TasaTH, seriesStringAll_GRI_EDEF_TasaTH, mainChart_GRI_EDEF_TasaTH)
seriesActual_GRI_EDEF_TasaTH = getSeriesFromString(seriesStringActual_GRI_EDEF_TasaTH, seriesAll_GRI_EDEF_TasaTH)
if(seriesActual_GRI_EDEF_TasaTH.length>0){
allSeries_GRI_EDEF_TasaTH = getAllValuesY(seriesActual_GRI_EDEF_TasaTH,leftSliderPos_GRI_EDEF_TasaTH,rightSliderPos_GRI_EDEF_TasaTH)
minLegend_GRI_EDEF_TasaTH = getSerieMin(allSeries_GRI_EDEF_TasaTH)
maxLegend_GRI_EDEF_TasaTH = getSerieMax(allSeries_GRI_EDEF_TasaTH)
}
else{
minLegend_GRI_EDEF_TasaTH=-20
maxLegend_GRI_EDEF_TasaTH=20
}
var seriesWidth_GRI_EDEF_TasaTH = [1, 2, 1, 2]
$("input[type=checkbox]").click(function(){
if(this.id == "s1_checkbox_GRI_EDEF_TasaTH") clickSerie1_GRI_EDEF_TasaTH = this.checked
else if(this.id == "s2_checkbox_GRI_EDEF_TasaTH") clickSerie2_GRI_EDEF_TasaTH = this.checked
else if(this.id == "s3_checkbox_GRI_EDEF_TasaTH") clickSerie3_GRI_EDEF_TasaTH = this.checked
else if(this.id == "s4_checkbox_GRI_EDEF_TasaTH") clickSerie4_GRI_EDEF_TasaTH= this.checked
// Ezkutatuta dagoen seriea tooltipa ez agertzeko
mainChart_GRI_EDEF_TasaTH.series[4].show = false;
mainChart_GRI_EDEF_TasaTH.series[0].show = clickSerie1_GRI_EDEF_TasaTH
mainChart_GRI_EDEF_TasaTH.series[1].show = clickSerie2_GRI_EDEF_TasaTH
mainChart_GRI_EDEF_TasaTH.series[2].show = clickSerie3_GRI_EDEF_TasaTH
mainChart_GRI_EDEF_TasaTH.series[3].show = clickSerie4_GRI_EDEF_TasaTH
seriesStringActual_GRI_EDEF_TasaTH = getSeriesClickedOnLegend(this, seriesStringActual_GRI_EDEF_TasaTH, seriesStringAll_GRI_EDEF_TasaTH, mainChart_GRI_EDEF_TasaTH)
seriesActual_GRI_EDEF_TasaTH = getSeriesFromString(seriesStringActual_GRI_EDEF_TasaTH, seriesAll_GRI_EDEF_TasaTH)
if(seriesActual_GRI_EDEF_TasaTH.length>0){
allSeries_GRI_EDEF_TasaTH = getAllValuesY(seriesActual_GRI_EDEF_TasaTH,leftSliderPos_GRI_EDEF_TasaTH,rightSliderPos_GRI_EDEF_TasaTH)
minLegend_GRI_EDEF_TasaTH = getSerieMin(allSeries_GRI_EDEF_TasaTH)
maxLegend_GRI_EDEF_TasaTH = getSerieMax(allSeries_GRI_EDEF_TasaTH)
}
else{
minLegend_GRI_EDEF_TasaTH=-20
maxLegend_GRI_EDEF_TasaTH=20
}
mainChart_GRI_EDEF_TasaTH.axes.yaxis.ticks = getYRange(1, maxLegend_GRI_EDEF_TasaTH)
mainChart_GRI_EDEF_TasaTH.axes.y2axis.ticks = getYRange(1, maxLegend_GRI_EDEF_TasaTH)
mainChart_GRI_EDEF_TasaTH.replot()
});
$("p").mouseenter(function() {
// Ezkutatuta dagoen seriea tooltipa ez agertzeko
mainChart_GRI_EDEF_TasaTH.series[4].show = false;
elementId_GRI_EDEF_TasaTH = this.id
clicks_GRI_EDEF_TasaTH = [clickSerie1_GRI_EDEF_TasaTH,clickSerie2_GRI_EDEF_TasaTH,clickSerie3_GRI_EDEF_TasaTH,clickSerie4_GRI_EDEF_TasaTH]
if(elementId_GRI_EDEF_TasaTH == "serie1Name_GRI_EDEF_TasaTH" && clickSerie1_GRI_EDEF_TasaTH == true){
series_GRI_EDEF_TasaTH = repaintLineWidth(elementId_GRI_EDEF_TasaTH, "enter", mainChart_GRI_EDEF_TasaTH, clicks_GRI_EDEF_TasaTH, seriesWidth_GRI_EDEF_TasaTH)
mainChart_GRI_EDEF_TasaTH.replot({series:series_GRI_EDEF_TasaTH})
mainChart_GRI_EDEF_TasaTH.moveSeriesToFront(0)
}
else if(elementId_GRI_EDEF_TasaTH == "serie2Name_GRI_EDEF_TasaTH" && clickSerie2_GRI_EDEF_TasaTH == true){
series_GRI_EDEF_TasaTH = repaintLineWidth(elementId_GRI_EDEF_TasaTH, "enter", mainChart_GRI_EDEF_TasaTH, clicks_GRI_EDEF_TasaTH, seriesWidth_GRI_EDEF_TasaTH)
mainChart_GRI_EDEF_TasaTH.replot({series:series_GRI_EDEF_TasaTH})
mainChart_GRI_EDEF_TasaTH.moveSeriesToFront(1)
}
else if(elementId_GRI_EDEF_TasaTH == "serie3Name_GRI_EDEF_TasaTH" && clickSerie3_GRI_EDEF_TasaTH == true){
series_GRI_EDEF_TasaTH = repaintLineWidth(elementId_GRI_EDEF_TasaTH, "enter", mainChart_GRI_EDEF_TasaTH, clicks_GRI_EDEF_TasaTH, seriesWidth_GRI_EDEF_TasaTH)
mainChart_GRI_EDEF_TasaTH.replot({series:series_GRI_EDEF_TasaTH})
mainChart_GRI_EDEF_TasaTH.moveSeriesToFront(2)
}
else if(elementId_GRI_EDEF_TasaTH == "serie4Name_GRI_EDEF_TasaTH" && clickSerie4_GRI_EDEF_TasaTH == true){
series_GRI_EDEF_TasaTH = repaintLineWidth(elementId_GRI_EDEF_TasaTH, "enter", mainChart_GRI_EDEF_TasaTH, clicks_GRI_EDEF_TasaTH, seriesWidth_GRI_EDEF_TasaTH)
mainChart_GRI_EDEF_TasaTH.replot({series:series_GRI_EDEF_TasaTH})
mainChart_GRI_EDEF_TasaTH.moveSeriesToFront(3)
}
seriesStringActual_GRI_EDEF_TasaTH = getSeriesClickedOnLegend(this, seriesStringActual_GRI_EDEF_TasaTH, seriesStringAll_GRI_EDEF_TasaTH, mainChart_GRI_EDEF_TasaTH)
seriesActual_GRI_EDEF_TasaTH = getSeriesFromString(seriesStringActual_GRI_EDEF_TasaTH, seriesAll_GRI_EDEF_TasaTH)
if(seriesActual_GRI_EDEF_TasaTH.length>0){
allSeries_GRI_EDEF_TasaTH = getAllValuesY(seriesActual_GRI_EDEF_TasaTH,leftSliderPos_GRI_EDEF_TasaTH,rightSliderPos_GRI_EDEF_TasaTH)
minLegend_GRI_EDEF_TasaTH = getSerieMin(allSeries_GRI_EDEF_TasaTH)
maxLegend_GRI_EDEF_TasaTH = getSerieMax(allSeries_GRI_EDEF_TasaTH)
}
else{
minLegend_GRI_EDEF_TasaTH=-20
maxLegend_GRI_EDEF_TasaTH=20
}
mainChart_GRI_EDEF_TasaTH.axes.yaxis.ticks = getYRange(1, maxLegend_GRI_EDEF_TasaTH)
mainChart_GRI_EDEF_TasaTH.axes.y2axis.ticks = getYRange(1, maxLegend_GRI_EDEF_TasaTH)
mainChart_GRI_EDEF_TasaTH.series[0].show = clickSerie1_GRI_EDEF_TasaTH
mainChart_GRI_EDEF_TasaTH.series[1].show = clickSerie2_GRI_EDEF_TasaTH
mainChart_GRI_EDEF_TasaTH.series[2].show = clickSerie3_GRI_EDEF_TasaTH
mainChart_GRI_EDEF_TasaTH.series[3].show = clickSerie4_GRI_EDEF_TasaTH
mainChart_GRI_EDEF_TasaTH.replot()
})
$("p").mouseleave(function() {
// Ezkutatuta dagoen seriea tooltipa ez agertzeko
mainChart_GRI_EDEF_TasaTH.series[4].show = false;
elementId_GRI_EDEF_TasaTH = this.id
clicks_GRI_EDEF_TasaTH = [clickSerie1_GRI_EDEF_TasaTH,clickSerie2_GRI_EDEF_TasaTH,clickSerie3_GRI_EDEF_TasaTH,clickSerie4_GRI_EDEF_TasaTH]
if(elementId_GRI_EDEF_TasaTH == "serie1Name_GRI_EDEF_TasaTH" && clickSerie1_GRI_EDEF_TasaTH == true){
series_GRI_EDEF_TasaTH = repaintLineWidth(elementId_GRI_EDEF_TasaTH, "exit", mainChart_GRI_EDEF_TasaTH, clicks_GRI_EDEF_TasaTH, seriesWidth_GRI_EDEF_TasaTH)
mainChart_GRI_EDEF_TasaTH.replot({series:series_GRI_EDEF_TasaTH})
}
else if(elementId_GRI_EDEF_TasaTH == "serie2Name_GRI_EDEF_TasaTH" && clickSerie2_GRI_EDEF_TasaTH == true){
series_GRI_EDEF_TasaTH = repaintLineWidth(elementId_GRI_EDEF_TasaTH, "exit", mainChart_GRI_EDEF_TasaTH, clicks_GRI_EDEF_TasaTH, seriesWidth_GRI_EDEF_TasaTH)
mainChart_GRI_EDEF_TasaTH.replot({series:series_GRI_EDEF_TasaTH})
}
else if(elementId_GRI_EDEF_TasaTH == "serie3Name_GRI_EDEF_TasaTH" && clickSerie3_GRI_EDEF_TasaTH == true){
series_GRI_EDEF_TasaTH = repaintLineWidth(elementId_GRI_EDEF_TasaTH, "exit", mainChart_GRI_EDEF_TasaTH, clicks_GRI_EDEF_TasaTH, seriesWidth_GRI_EDEF_TasaTH)
mainChart_GRI_EDEF_TasaTH.replot({series:series_GRI_EDEF_TasaTH})
}
else if(elementId_GRI_EDEF_TasaTH == "serie4Name_GRI_EDEF_TasaTH" && clickSerie4_GRI_EDEF_TasaTH == true){
series_GRI_EDEF_TasaTH = repaintLineWidth(elementId_GRI_EDEF_TasaTH, "exit", mainChart_GRI_EDEF_TasaTH, clicks_GRI_EDEF_TasaTH, seriesWidth_GRI_EDEF_TasaTH)
mainChart_GRI_EDEF_TasaTH.replot({series:series_GRI_EDEF_TasaTH})
}
mainChart_GRI_EDEF_TasaTH.axes.yaxis.ticks = getYRange(1, maxLegend_GRI_EDEF_TasaTH)
mainChart_GRI_EDEF_TasaTH.axes.y2axis.ticks = getYRange(1, maxLegend_GRI_EDEF_TasaTH)
mainChart_GRI_EDEF_TasaTH.series[0].show = clickSerie1_GRI_EDEF_TasaTH
mainChart_GRI_EDEF_TasaTH.series[1].show = clickSerie2_GRI_EDEF_TasaTH
mainChart_GRI_EDEF_TasaTH.series[2].show = clickSerie3_GRI_EDEF_TasaTH
mainChart_GRI_EDEF_TasaTH.series[3].show = clickSerie4_GRI_EDEF_TasaTH
/* Lehenengo serieari garrantzia emateko */
mainChart_GRI_EDEF_TasaTH.moveSeriesToFront(0)
mainChart_GRI_EDEF_TasaTH.replot()
})
/* Slider-aren grafikoa marraztu */
var sliderChart_GRI_EDEF_TasaTH = $.jqplot ('chart2_GRI_EDEF_TasaTH', [s1_kopia_GRI_EDEF_TasaTH,s2_kopia_GRI_EDEF_TasaTH,s3_kopia_GRI_EDEF_TasaTH,s4_kopia_GRI_EDEF_TasaTH], {
grid: {
background: 'white',
drawBorder: false,
shadow: false,
},
seriesColors: ["#0000FF", "#FFA500", "#008000", "#FF0000"],
series:[
{label:serieNames_GRI_EDEF_TasaTH[0],renderer:$.jqplot.LineRenderer,color: "#0000FF",lineWidth: 1,rendererOptions:{smooth:true},pointLabels:{show:false},markerOptions:{size:0}},
{label:serieNames_GRI_EDEF_TasaTH[1],renderer:$.jqplot.LineRenderer,color: "#FFA500",lineWidth: 1,rendererOptions:{smooth:true},pointLabels:{show:false},markerOptions:{size:0}},
{label:serieNames_GRI_EDEF_TasaTH[2],renderer:$.jqplot.LineRenderer,color: "#008000",lineWidth: 1,rendererOptions:{smooth:true},pointLabels:{show:false},markerOptions:{size:0}},
{label:serieNames_GRI_EDEF_TasaTH[3],renderer:$.jqplot.LineRenderer,color: "#FF0000",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_EDEF_TasaTH = formatTickLabelSlider(val, s1_kopia_GRI_EDEF_TasaTH[0][0], s1_kopia_GRI_EDEF_TasaTH[s1_kopia_GRI_EDEF_TasaTH.length-1][0], s1_GRI_EDEF_TasaTH, language, "yearly_data")
return tickName_GRI_EDEF_TasaTH
},
textColor: 'black'
},
ticks : getXRangeSlider(s1_kopia_GRI_EDEF_TasaTH[0][0], s1_kopia_GRI_EDEF_TasaTH[s1_kopia_GRI_EDEF_TasaTH.length-1][0]),
drawMajorGridlines: true,
drawMinorGridlines: true
},
yaxis: {
rendererOptions: {forceTickAt0: true},
tickOptions: {formatString: "%#.1f" },
showTicks: false,
min: 1,
max:maxYSliderGraph_GRI_EDEF_TasaTH + yAddedQuantity_GRI_EDEF_TasaTH
}
}
});
/* SliderChart-eko hasierako laukizuzenak marrazteko*/
sliderChart_GRI_EDEF_TasaTH.replot({
canvasOverlay: {
show: true,
objects: [
{ rectangle: { xmin:0,xmax: minSliderPos_GRI_EDEF_TasaTH, xminOffset: "0px", xmaxOffset: "0px", yminOffset: "0px", ymaxOffset: "0px",
color: "rgba(192,192,192,0.5)"} },
{ rectangle: { xmin:maxSliderPos_GRI_EDEF_TasaTH,xmax: s1_kopia_GRI_EDEF_TasaTH[s1_kopia_GRI_EDEF_TasaTH.length - 1][0], xminOffset: "0px", xmaxOffset: "0px", yminOffset: "0px", ymaxOffset: "0px",
color: "rgba(192,192,192,0.5)"} }
]
}
})
sliderChart_GRI_EDEF_TasaTH.moveSeriesToFront(0)
/* Slider-a marraztu */
$("#slider_GRI_EDEF_TasaTH").slider({
max: maxSlider_GRI_EDEF_TasaTH,
min: minSlider_GRI_EDEF_TasaTH,
range: true,
values: [ minSliderPos_GRI_EDEF_TasaTH, maxSliderPos_GRI_EDEF_TasaTH ],
slide: function(event,ui){
var serie1New_GRI_EDEF_TasaTH = new Array()
var serie2New_GRI_EDEF_TasaTH = new Array()
var serie3New_GRI_EDEF_TasaTH = new Array()
var serie4New_GRI_EDEF_TasaTH = new Array()
var datesArrayBerria_GRI_EDEF_TasaTH = new Array()
for(i=ui.values[0];i<=ui.values[1];i++)
{
serie1New_GRI_EDEF_TasaTH.push(s1_GRI_EDEF_TasaTH[i]);
serie2New_GRI_EDEF_TasaTH.push(s2_GRI_EDEF_TasaTH[i]);
serie3New_GRI_EDEF_TasaTH.push(s3_GRI_EDEF_TasaTH[i]);
serie4New_GRI_EDEF_TasaTH.push(s4_GRI_EDEF_TasaTH[i]);
datesArrayBerria_GRI_EDEF_TasaTH.push(s1_GRI_EDEF_TasaTH[i][0])
}
var valuesNew_GRI_EDEF_TasaTH = getAllValuesY([serie1New_GRI_EDEF_TasaTH, serie2New_GRI_EDEF_TasaTH, serie3New_GRI_EDEF_TasaTH,serie4New_GRI_EDEF_TasaTH],0,serie1New_GRI_EDEF_TasaTH.length-1)
min_GRI_EDEF_TasaTH = getSerieMin(valuesNew_GRI_EDEF_TasaTH)
max_GRI_EDEF_TasaTH = getSerieMax(valuesNew_GRI_EDEF_TasaTH)
serieBerria1_GRI_EDEF_TasaTH = changeSeries(serie1New_GRI_EDEF_TasaTH)
serieBerria2_GRI_EDEF_TasaTH = changeSeries(serie2New_GRI_EDEF_TasaTH)
serieBerria3_GRI_EDEF_TasaTH = changeSeries(serie3New_GRI_EDEF_TasaTH)
serieBerria4_GRI_EDEF_TasaTH = changeSeries(serie4New_GRI_EDEF_TasaTH)
mainChart_GRI_EDEF_TasaTH.destroy()
mainChart_GRI_EDEF_TasaTH = $.jqplot ('chart1_GRI_EDEF_TasaTH', [serieBerria1_GRI_EDEF_TasaTH,serieBerria2_GRI_EDEF_TasaTH,serieBerria3_GRI_EDEF_TasaTH, serieBerria4_GRI_EDEF_TasaTH,s1_hidden_GRI_EDEF_TasaTH], {
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", "#FF0000", "black"],
series:[
{label:serieNames_GRI_EDEF_TasaTH[0],show:document.getElementById("s1_checkbox_GRI_EDEF_TasaTH").checked,renderer:$.jqplot.LineRenderer,color:"#0000FF",lineWidth:1,rendererOptions:{smooth:true},pointLabels:{show:false},markerOptions:{size:0}},
{label:serieNames_GRI_EDEF_TasaTH[1],show:document.getElementById("s2_checkbox_GRI_EDEF_TasaTH").checked,renderer:$.jqplot.LineRenderer,color:"#FFA500",lineWidth:1,rendererOptions:{smooth:true},pointLabels:{show:false},markerOptions:{size:0}},
{label:serieNames_GRI_EDEF_TasaTH[2],show:document.getElementById("s3_checkbox_GRI_EDEF_TasaTH").checked,renderer:$.jqplot.LineRenderer,color:"#008000",lineWidth:1,rendererOptions:{smooth:true},pointLabels:{show:false},markerOptions:{size:0}},
{label:serieNames_GRI_EDEF_TasaTH[3],show:document.getElementById("s4_checkbox_GRI_EDEF_TasaTH").checked,renderer:$.jqplot.LineRenderer,color:"#FF0000",lineWidth:1,rendererOptions:{smooth:true},pointLabels:{show:false},markerOptions:{size:0}},
{yaxis:"y2axis",renderer:$.jqplot.LineRenderer,color:"#FF0000"}
],
axesDefaults: {
labelRenderer: $.jqplot.CanvasAxisLabelRenderer
},
axes: {
xaxis: {
//tickRenderer: $.jqplot.CanvasAxisTickRenderer,
tickOptions: {
formatter: function (format, val) {
tickName_GRI_EDEF_TasaTH = formatTickLabel(val, serieBerria1_GRI_EDEF_TasaTH[0][0], serieBerria1_GRI_EDEF_TasaTH[serieBerria1_GRI_EDEF_TasaTH.length-1][0], serie1New_GRI_EDEF_TasaTH, language, "yearly_data")
return tickName_GRI_EDEF_TasaTH
},
textColor: 'black'
},
ticks : getXRange(serieBerria1_GRI_EDEF_TasaTH[0][0], serieBerria1_GRI_EDEF_TasaTH[serieBerria1_GRI_EDEF_TasaTH.length-1][0]),
drawMajorGridlines: true
},
yaxis: {
tickOptions: {formatString: "%#.1f" },
ticks:getYRange(0, max_GRI_EDEF_TasaTH)
},
y2axis: {
rendererOptions: {alignTicks: true},
tickOptions: {formatString: "%#.1f" },
ticks:getYRange(0, max_GRI_EDEF_TasaTH)
}
},
highlighter: {
show: true,
tooltipContentEditor: function (str, seriesIndex, pointIndex, plot) {
var date_GRI_EDEF_TasaTH = datesArrayBerria_GRI_EDEF_TasaTH[plot.data[seriesIndex][pointIndex][0]];
var s_name_GRI_EDEF_TasaTH = plot.series[seriesIndex]["label"];
num_GRI_EDEF_TasaTH = plot.data[seriesIndex][pointIndex][1]
var value_GRI_EDEF_TasaTH = num_GRI_EDEF_TasaTH//plot.data[seriesIndex][pointIndex][1];
var yearString_GRI_EDEF_TasaTH = date_GRI_EDEF_TasaTH.substring(6,10);
var monthString_GRI_EDEF_TasaTH = date_GRI_EDEF_TasaTH.substring(3,5);
if ("yearly_data"==="yearly_data") {
monthName_GRI_EDEF_TasaTH = "";
} else if ("quarterly_data"==="yearly_data") {
monthName_GRI_EDEF_TasaTH = getQuarter(monthString_GRI_EDEF_TasaTH, language) + ", ";
} else {
monthName_GRI_EDEF_TasaTH = getMonthHighlight(monthString_GRI_EDEF_TasaTH, language) + ", ";
}
var html_GRI_EDEF_TasaTH = " ";
html_GRI_EDEF_TasaTH += "" + monthName_GRI_EDEF_TasaTH + yearString_GRI_EDEF_TasaTH + "";
html_GRI_EDEF_TasaTH += "
";
html_GRI_EDEF_TasaTH += s_name_GRI_EDEF_TasaTH + ": ";
html_GRI_EDEF_TasaTH += "" + number_format(value_GRI_EDEF_TasaTH, 1) + "";
html_GRI_EDEF_TasaTH += "
";
return html_GRI_EDEF_TasaTH;
},
sizeAdjust: 8.5,
//tooltipLocation : 'n'
}
});
// Ezkutatuta dagoen seriea tooltipa ez agertzeko
mainChart_GRI_EDEF_TasaTH.series[4].show = false;
/* Line-chart-ari dagokion lehenengo serieari garrantzia emateko */
mainChart_GRI_EDEF_TasaTH.moveSeriesToFront(0)
/* SliderChart-eko momentuko laukizuzenak marrazteko*/
sliderChart_GRI_EDEF_TasaTH.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_EDEF_TasaTH[s1_kopia_GRI_EDEF_TasaTH.length - 1][0], xminOffset: "0px", xmaxOffset: "0px", yminOffset: "0px", ymaxOffset: "0px",
color: "rgba(192,192,192,0.5)"} }
]
}
})
sliderChart_GRI_EDEF_TasaTH.moveSeriesToFront(0)
/* Legendan klikatuta dauden serieen maximo eta minimoa eguneratzeko*/
leftSliderPos_GRI_EDEF_TasaTH = ui.values[0]
rightSliderPos_GRI_EDEF_TasaTH = ui.values[1]
seriesStringActual_GRI_EDEF_TasaTH = getSeriesClickedOnLegend(this, seriesStringActual_GRI_EDEF_TasaTH, seriesStringAll_GRI_EDEF_TasaTH, mainChart_GRI_EDEF_TasaTH)
seriesActual_GRI_EDEF_TasaTH = getSeriesFromString(seriesStringActual_GRI_EDEF_TasaTH, seriesAll_GRI_EDEF_TasaTH)
allSeries_GRI_EDEF_TasaTH = getAllValuesY(seriesActual_GRI_EDEF_TasaTH,leftSliderPos_GRI_EDEF_TasaTH,rightSliderPos_GRI_EDEF_TasaTH)
minLegend_GRI_EDEF_TasaTH = getSerieMin(allSeries_GRI_EDEF_TasaTH)
maxLegend_GRI_EDEF_TasaTH = getSerieMax(allSeries_GRI_EDEF_TasaTH)
mainChart_GRI_EDEF_TasaTH.axes.yaxis.ticks = getYRange(1, maxLegend_GRI_EDEF_TasaTH)
mainChart_GRI_EDEF_TasaTH.axes.y2axis.ticks = getYRange(1, maxLegend_GRI_EDEF_TasaTH)
mainChart_GRI_EDEF_TasaTH.replot();
}
});
/* */
function repaintLineWidth(serieId, eventType, mainChart, clicks, seriesWidth){
var series_GRI_EDEF_TasaTH;
if (serieId == "serie1Name_GRI_EDEF_TasaTH" && 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: TAMANOpx; font-style: italic; font-weight: normal;");
}
else if (serieId == "serie1Name_GRI_EDEF_TasaTH" && eventType == "exit"){
if(clicks[0] == true) seriesWidth[0] = seriesWidth[0] -1
document.getElementById(serieId).setAttribute("style", "font-family: Verdana !important; font-size: TAMANOpx; font-style: italic; font-weight: normal;");
}
if (serieId == "serie2Name_GRI_EDEF_TasaTH" && 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: TAMANOpx; font-style: italic; font-weight: normal;");
}
else if (serieId == "serie2Name_GRI_EDEF_TasaTH" && eventType == "exit"){
if(clicks[1] == true)seriesWidth[1] = seriesWidth[1] - 1
document.getElementById(serieId).setAttribute("style", "font-family: Verdana !important; font-size: TAMANOpx; font-style: italic; font-weight: normal;");
}
if (serieId == "serie3Name_GRI_EDEF_TasaTH" && 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: TAMANOpx; font-style: italic; font-weight: normal;");
}
else if (serieId == "serie3Name_GRI_EDEF_TasaTH" && eventType == "exit"){
if(clicks[2] == true)seriesWidth[2] = seriesWidth[2] - 1
document.getElementById(serieId).setAttribute("style", "font-family: Verdana !important; font-size: TAMANOpx; font-style: italic; font-weight: normal;");
}
if (serieId == "serie4Name_GRI_EDEF_TasaTH" && eventType == "enter"){
if(clicks[3] == true)seriesWidth[3] = seriesWidth[3] + 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: TAMANOpx; font-style: italic; font-weight: normal;");
}
else if (serieId == "serie4Name_GRI_EDEF_TasaTH" && eventType == "exit"){
if(clicks[3] == true)seriesWidth[3] = seriesWidth[3] - 1
document.getElementById(serieId).setAttribute("style", "font-family: Verdana !important; font-size: TAMANOpx; font-style: italic; font-weight: normal;");
}
series_GRI_EDEF_TasaTH = [{lineWidth: seriesWidth[0]},{lineWidth: seriesWidth[1]},{lineWidth: seriesWidth[2]},{lineWidth: seriesWidth[3]},{lineWidth: 0.01}]
return series_GRI_EDEF_TasaTH;
}
/* Funtzio honek Legend-an klikaturik dauden serieen array-a itzultzen du eta seriea pintatu/ez pintatu */
function getSeriesClickedOnLegend(thisClicked, seriesActual, seriesAll, mainChart){
result_GRI_EDEF_TasaTH = seriesActual
if(thisClicked.value=="s1_legend_GRI_EDEF_TasaTH"){
index = indexOfSerieClicked(thisClicked.value, seriesActual)
if(thisClicked.checked == true){
result_GRI_EDEF_TasaTH.splice(index, 0, seriesAll[0]);
}
else{
result_GRI_EDEF_TasaTH.splice(index, 1);
}
mainChart.series[0].show = thisClicked.checked;
}
if(thisClicked.value=="s2_legend_GRI_EDEF_TasaTH"){
index = indexOfSerieClicked(thisClicked.value, seriesActual)
if(thisClicked.checked == true){
result_GRI_EDEF_TasaTH.splice(index, 0, seriesAll[1]);
}
else{
result_GRI_EDEF_TasaTH.splice(index, 1);
}
mainChart.series[1].show = thisClicked.checked;
}
if(thisClicked.value=="s3_legend_GRI_EDEF_TasaTH"){
index = indexOfSerieClicked(thisClicked.value, seriesActual)
if(thisClicked.checked == true){
result_GRI_EDEF_TasaTH.splice(index, 0, seriesAll[2]);
}
else{
result_GRI_EDEF_TasaTH.splice(index, 1);
}
mainChart.series[2].show = thisClicked.checked;
}
if(thisClicked.value=="s4_legend_GRI_EDEF_TasaTH"){
index = indexOfSerieClicked(thisClicked.value, seriesActual)
if(thisClicked.checked == true){
result_GRI_EDEF_TasaTH.splice(index, 0, seriesAll[3]);
}
else{
result_GRI_EDEF_TasaTH.splice(index, 1);
}
mainChart.series[3].show = thisClicked.checked;
}
return result_GRI_EDEF_TasaTH
}
});