";
html_CS_Gasto_T_Salud_Hab_PPS += "
";
html_CS_Gasto_T_Salud_Hab_PPS += s_name_CS_Gasto_T_Salud_Hab_PPS + ": ";
html_CS_Gasto_T_Salud_Hab_PPS += "" + number_format(value_CS_Gasto_T_Salud_Hab_PPS,0) + "";
html_CS_Gasto_T_Salud_Hab_PPS += "";
return html_CS_Gasto_T_Salud_Hab_PPS;
},
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_CS_Gasto_T_Salud_Hab_PPS = true
var clickSerie2_CS_Gasto_T_Salud_Hab_PPS = true
var clickSerie3_CS_Gasto_T_Salud_Hab_PPS = true
if (!document.getElementById("s1_checkbox_CS_Gasto_T_Salud_Hab_PPS").checked) clickSerie1_CS_Gasto_T_Salud_Hab_PPS = false;
if (!document.getElementById("s2_checkbox_CS_Gasto_T_Salud_Hab_PPS").checked) clickSerie2_CS_Gasto_T_Salud_Hab_PPS = false;
if (!document.getElementById("s3_checkbox_CS_Gasto_T_Salud_Hab_PPS").checked) clickSerie3_CS_Gasto_T_Salud_Hab_PPS = false;
mainChart_CS_Gasto_T_Salud_Hab_PPS.series[0].show = clickSerie1_CS_Gasto_T_Salud_Hab_PPS;
mainChart_CS_Gasto_T_Salud_Hab_PPS.series[1].show = clickSerie2_CS_Gasto_T_Salud_Hab_PPS;
mainChart_CS_Gasto_T_Salud_Hab_PPS.series[2].show = clickSerie3_CS_Gasto_T_Salud_Hab_PPS;
// Ezkutatuta dagoen seriea tooltipa ez agertzeko
//mainChart_CS_Gasto_T_Salud_Hab_PPS.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_CS_Gasto_T_Salud_Hab_PPS.moveSeriesToFront(0)
mainChart_CS_Gasto_T_Salud_Hab_PPS.replot()
/* Legendako serieak erakusteko/ez erakusteko */
var leftSliderPos_CS_Gasto_T_Salud_Hab_PPS = minSliderPos_CS_Gasto_T_Salud_Hab_PPS
var rightSliderPos_CS_Gasto_T_Salud_Hab_PPS = maxSliderPos_CS_Gasto_T_Salud_Hab_PPS
var minLegend_CS_Gasto_T_Salud_Hab_PPS
var maxLegend_CS_Gasto_T_Salud_Hab_PPS
var seriesStringAll_CS_Gasto_T_Salud_Hab_PPS = ["s1","s2","s3"]
var seriesStringActual_CS_Gasto_T_Salud_Hab_PPS = ["s1","s2","s3"]
var seriesAll_CS_Gasto_T_Salud_Hab_PPS = [s1_CS_Gasto_T_Salud_Hab_PPS,s2_CS_Gasto_T_Salud_Hab_PPS,s3_CS_Gasto_T_Salud_Hab_PPS]
var seriesActual_CS_Gasto_T_Salud_Hab_PPS;
seriesStringActual_CS_Gasto_T_Salud_Hab_PPS = getSeriesClickedOnLegend(this, seriesStringActual_CS_Gasto_T_Salud_Hab_PPS, seriesStringAll_CS_Gasto_T_Salud_Hab_PPS, mainChart_CS_Gasto_T_Salud_Hab_PPS)
seriesActual_CS_Gasto_T_Salud_Hab_PPS = getSeriesFromString(seriesStringActual_CS_Gasto_T_Salud_Hab_PPS, seriesAll_CS_Gasto_T_Salud_Hab_PPS)
if(seriesActual_CS_Gasto_T_Salud_Hab_PPS.length>0){
allSeries_CS_Gasto_T_Salud_Hab_PPS = getAllValuesY(seriesActual_CS_Gasto_T_Salud_Hab_PPS,leftSliderPos_CS_Gasto_T_Salud_Hab_PPS,rightSliderPos_CS_Gasto_T_Salud_Hab_PPS)
minLegend_CS_Gasto_T_Salud_Hab_PPS = getSerieMin(allSeries_CS_Gasto_T_Salud_Hab_PPS)
maxLegend_CS_Gasto_T_Salud_Hab_PPS = getSerieMax(allSeries_CS_Gasto_T_Salud_Hab_PPS)
}
else{
minLegend_CS_Gasto_T_Salud_Hab_PPS=-20
maxLegend_CS_Gasto_T_Salud_Hab_PPS=20
}
var seriesWidth_CS_Gasto_T_Salud_Hab_PPS = [1, 1, 1]
$("input[type=checkbox]").click(function(){
if(this.id == "s1_checkbox_CS_Gasto_T_Salud_Hab_PPS") clickSerie1_CS_Gasto_T_Salud_Hab_PPS = this.checked
else if(this.id == "s2_checkbox_CS_Gasto_T_Salud_Hab_PPS") clickSerie2_CS_Gasto_T_Salud_Hab_PPS = this.checked
else if(this.id == "s3_checkbox_CS_Gasto_T_Salud_Hab_PPS") clickSerie3_CS_Gasto_T_Salud_Hab_PPS = this.checked
// Ezkutatuta dagoen seriea tooltipa ez agertzeko
mainChart_CS_Gasto_T_Salud_Hab_PPS.series[3].show = false;
mainChart_CS_Gasto_T_Salud_Hab_PPS.series[0].show = clickSerie1_CS_Gasto_T_Salud_Hab_PPS
mainChart_CS_Gasto_T_Salud_Hab_PPS.series[1].show = clickSerie2_CS_Gasto_T_Salud_Hab_PPS
mainChart_CS_Gasto_T_Salud_Hab_PPS.series[2].show = clickSerie3_CS_Gasto_T_Salud_Hab_PPS
seriesStringActual_CS_Gasto_T_Salud_Hab_PPS = getSeriesClickedOnLegend(this, seriesStringActual_CS_Gasto_T_Salud_Hab_PPS, seriesStringAll_CS_Gasto_T_Salud_Hab_PPS, mainChart_CS_Gasto_T_Salud_Hab_PPS)
seriesActual_CS_Gasto_T_Salud_Hab_PPS = getSeriesFromString(seriesStringActual_CS_Gasto_T_Salud_Hab_PPS, seriesAll_CS_Gasto_T_Salud_Hab_PPS)
if(seriesActual_CS_Gasto_T_Salud_Hab_PPS.length>0){
allSeries_CS_Gasto_T_Salud_Hab_PPS = getAllValuesY(seriesActual_CS_Gasto_T_Salud_Hab_PPS,leftSliderPos_CS_Gasto_T_Salud_Hab_PPS,rightSliderPos_CS_Gasto_T_Salud_Hab_PPS)
minLegend_CS_Gasto_T_Salud_Hab_PPS = getSerieMin(allSeries_CS_Gasto_T_Salud_Hab_PPS)
maxLegend_CS_Gasto_T_Salud_Hab_PPS = getSerieMax(allSeries_CS_Gasto_T_Salud_Hab_PPS)
}
else{
minLegend_CS_Gasto_T_Salud_Hab_PPS=-20
maxLegend_CS_Gasto_T_Salud_Hab_PPS=20
}
mainChart_CS_Gasto_T_Salud_Hab_PPS.axes.yaxis.ticks = getYRange(0.1, maxLegend_CS_Gasto_T_Salud_Hab_PPS)
mainChart_CS_Gasto_T_Salud_Hab_PPS.axes.y2axis.ticks = getYRange(0.1, maxLegend_CS_Gasto_T_Salud_Hab_PPS)
mainChart_CS_Gasto_T_Salud_Hab_PPS.replot()
});
$("p").mouseenter(function() {
// Ezkutatuta dagoen seriea tooltipa ez agertzeko
mainChart_CS_Gasto_T_Salud_Hab_PPS.series[3].show = false;
elementId_CS_Gasto_T_Salud_Hab_PPS = this.id
clicks_CS_Gasto_T_Salud_Hab_PPS = [clickSerie1_CS_Gasto_T_Salud_Hab_PPS,clickSerie2_CS_Gasto_T_Salud_Hab_PPS,clickSerie3_CS_Gasto_T_Salud_Hab_PPS]
if(elementId_CS_Gasto_T_Salud_Hab_PPS == "serie1Name_CS_Gasto_T_Salud_Hab_PPS" && clickSerie1_CS_Gasto_T_Salud_Hab_PPS == true){
series_CS_Gasto_T_Salud_Hab_PPS = repaintLineWidth(elementId_CS_Gasto_T_Salud_Hab_PPS, "enter", mainChart_CS_Gasto_T_Salud_Hab_PPS, clicks_CS_Gasto_T_Salud_Hab_PPS, seriesWidth_CS_Gasto_T_Salud_Hab_PPS)
mainChart_CS_Gasto_T_Salud_Hab_PPS.replot({series:series_CS_Gasto_T_Salud_Hab_PPS})
mainChart_CS_Gasto_T_Salud_Hab_PPS.moveSeriesToFront(0)
}
else if(elementId_CS_Gasto_T_Salud_Hab_PPS == "serie2Name_CS_Gasto_T_Salud_Hab_PPS" && clickSerie2_CS_Gasto_T_Salud_Hab_PPS == true){
series_CS_Gasto_T_Salud_Hab_PPS = repaintLineWidth(elementId_CS_Gasto_T_Salud_Hab_PPS, "enter", mainChart_CS_Gasto_T_Salud_Hab_PPS, clicks_CS_Gasto_T_Salud_Hab_PPS, seriesWidth_CS_Gasto_T_Salud_Hab_PPS)
mainChart_CS_Gasto_T_Salud_Hab_PPS.replot({series:series_CS_Gasto_T_Salud_Hab_PPS})
mainChart_CS_Gasto_T_Salud_Hab_PPS.moveSeriesToFront(1)
}
else if(elementId_CS_Gasto_T_Salud_Hab_PPS == "serie3Name_CS_Gasto_T_Salud_Hab_PPS" && clickSerie3_CS_Gasto_T_Salud_Hab_PPS == true){
series_CS_Gasto_T_Salud_Hab_PPS = repaintLineWidth(elementId_CS_Gasto_T_Salud_Hab_PPS, "enter", mainChart_CS_Gasto_T_Salud_Hab_PPS, clicks_CS_Gasto_T_Salud_Hab_PPS, seriesWidth_CS_Gasto_T_Salud_Hab_PPS)
mainChart_CS_Gasto_T_Salud_Hab_PPS.replot({series:series_CS_Gasto_T_Salud_Hab_PPS})
mainChart_CS_Gasto_T_Salud_Hab_PPS.moveSeriesToFront(2)
}
seriesStringActual_CS_Gasto_T_Salud_Hab_PPS = getSeriesClickedOnLegend(this, seriesStringActual_CS_Gasto_T_Salud_Hab_PPS, seriesStringAll_CS_Gasto_T_Salud_Hab_PPS, mainChart_CS_Gasto_T_Salud_Hab_PPS)
seriesActual_CS_Gasto_T_Salud_Hab_PPS = getSeriesFromString(seriesStringActual_CS_Gasto_T_Salud_Hab_PPS, seriesAll_CS_Gasto_T_Salud_Hab_PPS)
if(seriesActual_CS_Gasto_T_Salud_Hab_PPS.length>0){
allSeries_CS_Gasto_T_Salud_Hab_PPS = getAllValuesY(seriesActual_CS_Gasto_T_Salud_Hab_PPS,leftSliderPos_CS_Gasto_T_Salud_Hab_PPS,rightSliderPos_CS_Gasto_T_Salud_Hab_PPS)
minLegend_CS_Gasto_T_Salud_Hab_PPS = getSerieMin(allSeries_CS_Gasto_T_Salud_Hab_PPS)
maxLegend_CS_Gasto_T_Salud_Hab_PPS = getSerieMax(allSeries_CS_Gasto_T_Salud_Hab_PPS)
}
else{
minLegend_CS_Gasto_T_Salud_Hab_PPS=-20
maxLegend_CS_Gasto_T_Salud_Hab_PPS=20
}
mainChart_CS_Gasto_T_Salud_Hab_PPS.axes.yaxis.ticks = getYRange(0.1, maxLegend_CS_Gasto_T_Salud_Hab_PPS)
mainChart_CS_Gasto_T_Salud_Hab_PPS.axes.y2axis.ticks = getYRange(0.1, maxLegend_CS_Gasto_T_Salud_Hab_PPS)
mainChart_CS_Gasto_T_Salud_Hab_PPS.series[0].show = clickSerie1_CS_Gasto_T_Salud_Hab_PPS
mainChart_CS_Gasto_T_Salud_Hab_PPS.series[1].show = clickSerie2_CS_Gasto_T_Salud_Hab_PPS
mainChart_CS_Gasto_T_Salud_Hab_PPS.series[2].show = clickSerie3_CS_Gasto_T_Salud_Hab_PPS
mainChart_CS_Gasto_T_Salud_Hab_PPS.replot()
})
$("p").mouseleave(function() {
// Ezkutatuta dagoen seriea tooltipa ez agertzeko
mainChart_CS_Gasto_T_Salud_Hab_PPS.series[3].show = false;
elementId_CS_Gasto_T_Salud_Hab_PPS = this.id
clicks_CS_Gasto_T_Salud_Hab_PPS = [clickSerie1_CS_Gasto_T_Salud_Hab_PPS,clickSerie2_CS_Gasto_T_Salud_Hab_PPS,clickSerie3_CS_Gasto_T_Salud_Hab_PPS]
if(elementId_CS_Gasto_T_Salud_Hab_PPS == "serie1Name_CS_Gasto_T_Salud_Hab_PPS" && clickSerie1_CS_Gasto_T_Salud_Hab_PPS == true){
series_CS_Gasto_T_Salud_Hab_PPS = repaintLineWidth(elementId_CS_Gasto_T_Salud_Hab_PPS, "exit", mainChart_CS_Gasto_T_Salud_Hab_PPS, clicks_CS_Gasto_T_Salud_Hab_PPS, seriesWidth_CS_Gasto_T_Salud_Hab_PPS)
mainChart_CS_Gasto_T_Salud_Hab_PPS.replot({series:series_CS_Gasto_T_Salud_Hab_PPS})
}
else if(elementId_CS_Gasto_T_Salud_Hab_PPS == "serie2Name_CS_Gasto_T_Salud_Hab_PPS" && clickSerie2_CS_Gasto_T_Salud_Hab_PPS == true){
series_CS_Gasto_T_Salud_Hab_PPS = repaintLineWidth(elementId_CS_Gasto_T_Salud_Hab_PPS, "exit", mainChart_CS_Gasto_T_Salud_Hab_PPS, clicks_CS_Gasto_T_Salud_Hab_PPS, seriesWidth_CS_Gasto_T_Salud_Hab_PPS)
mainChart_CS_Gasto_T_Salud_Hab_PPS.replot({series:series_CS_Gasto_T_Salud_Hab_PPS})
}
else if(elementId_CS_Gasto_T_Salud_Hab_PPS == "serie3Name_CS_Gasto_T_Salud_Hab_PPS" && clickSerie3_CS_Gasto_T_Salud_Hab_PPS == true){
series_CS_Gasto_T_Salud_Hab_PPS = repaintLineWidth(elementId_CS_Gasto_T_Salud_Hab_PPS, "exit", mainChart_CS_Gasto_T_Salud_Hab_PPS, clicks_CS_Gasto_T_Salud_Hab_PPS, seriesWidth_CS_Gasto_T_Salud_Hab_PPS)
mainChart_CS_Gasto_T_Salud_Hab_PPS.replot({series:series_CS_Gasto_T_Salud_Hab_PPS})
}
mainChart_CS_Gasto_T_Salud_Hab_PPS.axes.yaxis.ticks = getYRange(0.1, maxLegend_CS_Gasto_T_Salud_Hab_PPS)
mainChart_CS_Gasto_T_Salud_Hab_PPS.axes.y2axis.ticks = getYRange(0.1, maxLegend_CS_Gasto_T_Salud_Hab_PPS)
mainChart_CS_Gasto_T_Salud_Hab_PPS.series[0].show = clickSerie1_CS_Gasto_T_Salud_Hab_PPS
mainChart_CS_Gasto_T_Salud_Hab_PPS.series[1].show = clickSerie2_CS_Gasto_T_Salud_Hab_PPS
mainChart_CS_Gasto_T_Salud_Hab_PPS.series[2].show = clickSerie3_CS_Gasto_T_Salud_Hab_PPS
/* Lehenengo serieari garrantzia emateko */
mainChart_CS_Gasto_T_Salud_Hab_PPS.moveSeriesToFront(0)
mainChart_CS_Gasto_T_Salud_Hab_PPS.replot()
})
/* Slider-aren grafikoa marraztu */
var sliderChart_CS_Gasto_T_Salud_Hab_PPS = $.jqplot ('chart2_CS_Gasto_T_Salud_Hab_PPS', [s1_kopia_CS_Gasto_T_Salud_Hab_PPS,s2_kopia_CS_Gasto_T_Salud_Hab_PPS,s3_kopia_CS_Gasto_T_Salud_Hab_PPS], {
grid: {
background: 'white',
drawBorder: false,
shadow: false,
},
seriesColors: ["#0000FF", "#FFA500", "#008000"],
series:[
{label:serieNames_CS_Gasto_T_Salud_Hab_PPS[0],renderer:$.jqplot.LineRenderer,color: "#0000FF",lineWidth: 1,rendererOptions:{smooth:true},pointLabels:{show:false},markerOptions:{size:0}},
{label:serieNames_CS_Gasto_T_Salud_Hab_PPS[1],renderer:$.jqplot.LineRenderer,color: "#FFA500",lineWidth: 1,rendererOptions:{smooth:true},pointLabels:{show:false},markerOptions:{size:0}},
{label:serieNames_CS_Gasto_T_Salud_Hab_PPS[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_CS_Gasto_T_Salud_Hab_PPS = formatTickLabelSlider(val, s1_kopia_CS_Gasto_T_Salud_Hab_PPS[0][0], s1_kopia_CS_Gasto_T_Salud_Hab_PPS[s1_kopia_CS_Gasto_T_Salud_Hab_PPS.length-1][0], s1_CS_Gasto_T_Salud_Hab_PPS, language, "yearly_data")
return tickName_CS_Gasto_T_Salud_Hab_PPS
},
textColor: 'black'
},
ticks : getXRangeSlider(s1_kopia_CS_Gasto_T_Salud_Hab_PPS[0][0], s1_kopia_CS_Gasto_T_Salud_Hab_PPS[s1_kopia_CS_Gasto_T_Salud_Hab_PPS.length-1][0]),
drawMajorGridlines: true,
drawMinorGridlines: true
},
yaxis: {
rendererOptions: {forceTickAt0: true},
tickOptions: {formatString: "%'i" },
showTicks: false,
min: 1,
max:maxYSliderGraph_CS_Gasto_T_Salud_Hab_PPS + yAddedQuantity_CS_Gasto_T_Salud_Hab_PPS
}
}
});
/* SliderChart-eko hasierako laukizuzenak marrazteko*/
sliderChart_CS_Gasto_T_Salud_Hab_PPS.replot({
canvasOverlay: {
show: true,
objects: [
{ rectangle: { xmin:0,xmax: minSliderPos_CS_Gasto_T_Salud_Hab_PPS, xminOffset: "0px", xmaxOffset: "0px", yminOffset: "0px", ymaxOffset: "0px",
color: "rgba(192,192,192,0.5)"} },
{ rectangle: { xmin:maxSliderPos_CS_Gasto_T_Salud_Hab_PPS,xmax: s1_kopia_CS_Gasto_T_Salud_Hab_PPS[s1_kopia_CS_Gasto_T_Salud_Hab_PPS.length - 1][0], xminOffset: "0px", xmaxOffset: "0px", yminOffset: "0px", ymaxOffset: "0px",
color: "rgba(192,192,192,0.5)"} }
]
}
})
sliderChart_CS_Gasto_T_Salud_Hab_PPS.moveSeriesToFront(0)
/* Slider-a marraztu */
$("#slider_CS_Gasto_T_Salud_Hab_PPS").slider({
max: maxSlider_CS_Gasto_T_Salud_Hab_PPS,
min: minSlider_CS_Gasto_T_Salud_Hab_PPS,
range: true,
values: [ minSliderPos_CS_Gasto_T_Salud_Hab_PPS, maxSliderPos_CS_Gasto_T_Salud_Hab_PPS ],
slide: function(event,ui){
var serie1New_CS_Gasto_T_Salud_Hab_PPS = new Array()
var serie2New_CS_Gasto_T_Salud_Hab_PPS = new Array()
var serie3New_CS_Gasto_T_Salud_Hab_PPS= new Array()
var datesArrayBerria_CS_Gasto_T_Salud_Hab_PPS = new Array()
for(i=ui.values[0];i<=ui.values[1];i++)
{
serie1New_CS_Gasto_T_Salud_Hab_PPS.push(s1_CS_Gasto_T_Salud_Hab_PPS[i]);
serie2New_CS_Gasto_T_Salud_Hab_PPS.push(s2_CS_Gasto_T_Salud_Hab_PPS[i]);
serie3New_CS_Gasto_T_Salud_Hab_PPS.push(s3_CS_Gasto_T_Salud_Hab_PPS[i]);
datesArrayBerria_CS_Gasto_T_Salud_Hab_PPS.push(s1_CS_Gasto_T_Salud_Hab_PPS[i][0])
}
var valuesNew_CS_Gasto_T_Salud_Hab_PPS = getAllValuesY([serie1New_CS_Gasto_T_Salud_Hab_PPS, serie2New_CS_Gasto_T_Salud_Hab_PPS, serie3New_CS_Gasto_T_Salud_Hab_PPS],0,serie1New_CS_Gasto_T_Salud_Hab_PPS.length-1)
min_CS_Gasto_T_Salud_Hab_PPS = getSerieMin(valuesNew_CS_Gasto_T_Salud_Hab_PPS)
max_CS_Gasto_T_Salud_Hab_PPS = getSerieMax(valuesNew_CS_Gasto_T_Salud_Hab_PPS)
serieBerria1_CS_Gasto_T_Salud_Hab_PPS = changeSeries(serie1New_CS_Gasto_T_Salud_Hab_PPS)
serieBerria2_CS_Gasto_T_Salud_Hab_PPS = changeSeries(serie2New_CS_Gasto_T_Salud_Hab_PPS)
serieBerria3_CS_Gasto_T_Salud_Hab_PPS = changeSeries(serie3New_CS_Gasto_T_Salud_Hab_PPS)
mainChart_CS_Gasto_T_Salud_Hab_PPS.destroy()
mainChart_CS_Gasto_T_Salud_Hab_PPS = $.jqplot ('chart1_CS_Gasto_T_Salud_Hab_PPS', [serieBerria1_CS_Gasto_T_Salud_Hab_PPS,serieBerria2_CS_Gasto_T_Salud_Hab_PPS,serieBerria3_CS_Gasto_T_Salud_Hab_PPS,s1_hidden_CS_Gasto_T_Salud_Hab_PPS], {
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_CS_Gasto_T_Salud_Hab_PPS[0],show:document.getElementById("s1_checkbox_CS_Gasto_T_Salud_Hab_PPS").checked,renderer:$.jqplot.LineRenderer,color:"#0000FF",lineWidth:1,rendererOptions:{smooth:true},pointLabels:{show:false},markerOptions:{size:0}},
{label:serieNames_CS_Gasto_T_Salud_Hab_PPS[1],show:document.getElementById("s2_checkbox_CS_Gasto_T_Salud_Hab_PPS").checked,renderer:$.jqplot.LineRenderer,color:"#FFA500",lineWidth:1,rendererOptions:{smooth:true},pointLabels:{show:false},markerOptions:{size:0}},
{label:serieNames_CS_Gasto_T_Salud_Hab_PPS[2],show:document.getElementById("s3_checkbox_CS_Gasto_T_Salud_Hab_PPS").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_CS_Gasto_T_Salud_Hab_PPS = formatTickLabel(val, serieBerria1_CS_Gasto_T_Salud_Hab_PPS[0][0], serieBerria1_CS_Gasto_T_Salud_Hab_PPS[serieBerria1_CS_Gasto_T_Salud_Hab_PPS.length-1][0], serie1New_CS_Gasto_T_Salud_Hab_PPS, language, "yearly_data")
return tickName_CS_Gasto_T_Salud_Hab_PPS
},
textColor: 'black'
},
ticks : getXRange(serieBerria1_CS_Gasto_T_Salud_Hab_PPS[0][0], serieBerria1_CS_Gasto_T_Salud_Hab_PPS[serieBerria1_CS_Gasto_T_Salud_Hab_PPS.length-1][0]),
drawMajorGridlines: true
},
yaxis: {
tickOptions: {formatString: "%'i" },
ticks:getYRange(0, max_CS_Gasto_T_Salud_Hab_PPS)
},
y2axis: {
rendererOptions: {alignTicks: true},
tickOptions: {formatString: "%'i" },
ticks:getYRange(0, max_CS_Gasto_T_Salud_Hab_PPS)
}
},
highlighter: {
show: true,
tooltipContentEditor: function (str, seriesIndex, pointIndex, plot) {
var date_CS_Gasto_T_Salud_Hab_PPS = datesArrayBerria_CS_Gasto_T_Salud_Hab_PPS[plot.data[seriesIndex][pointIndex][0]];
var s_name_CS_Gasto_T_Salud_Hab_PPS = plot.series[seriesIndex]["label"];
num_CS_Gasto_T_Salud_Hab_PPS = plot.data[seriesIndex][pointIndex][1]
var value_CS_Gasto_T_Salud_Hab_PPS = num_CS_Gasto_T_Salud_Hab_PPS//plot.data[seriesIndex][pointIndex][1];
var yearString_CS_Gasto_T_Salud_Hab_PPS = date_CS_Gasto_T_Salud_Hab_PPS.substring(6,10);
var monthString_CS_Gasto_T_Salud_Hab_PPS = date_CS_Gasto_T_Salud_Hab_PPS.substring(3,5);
if ("yearly_data"==="yearly_data") {
monthName_CS_Gasto_T_Salud_Hab_PPS = "";
} else if ("quarterly_data"==="yearly_data") {
monthName_CS_Gasto_T_Salud_Hab_PPS = getQuarter(monthString_CS_Gasto_T_Salud_Hab_PPS, language) + ", ";
} else {
monthName_CS_Gasto_T_Salud_Hab_PPS = getMonthHighlight(monthString_CS_Gasto_T_Salud_Hab_PPS, language) + ", ";
}
var html_CS_Gasto_T_Salud_Hab_PPS = " ";
html_CS_Gasto_T_Salud_Hab_PPS += "" + monthName_CS_Gasto_T_Salud_Hab_PPS + yearString_CS_Gasto_T_Salud_Hab_PPS + "";
html_CS_Gasto_T_Salud_Hab_PPS += "
";
html_CS_Gasto_T_Salud_Hab_PPS += s_name_CS_Gasto_T_Salud_Hab_PPS + ": ";
html_CS_Gasto_T_Salud_Hab_PPS += "" + number_format(value_CS_Gasto_T_Salud_Hab_PPS, 0) + "";
html_CS_Gasto_T_Salud_Hab_PPS += "
";
return html_CS_Gasto_T_Salud_Hab_PPS;
},
sizeAdjust: 8.5,
//tooltipLocation : 'n'
}
});
// Ezkutatuta dagoen seriea tooltipa ez agertzeko
mainChart_CS_Gasto_T_Salud_Hab_PPS.series[3].show = false;
/* Line-chart-ari dagokion lehenengo serieari garrantzia emateko */
mainChart_CS_Gasto_T_Salud_Hab_PPS.moveSeriesToFront(0)
/* SliderChart-eko momentuko laukizuzenak marrazteko*/
sliderChart_CS_Gasto_T_Salud_Hab_PPS.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_CS_Gasto_T_Salud_Hab_PPS[s1_kopia_CS_Gasto_T_Salud_Hab_PPS.length - 1][0], xminOffset: "0px", xmaxOffset: "0px", yminOffset: "0px", ymaxOffset: "0px",
color: "rgba(192,192,192,0.5)"} }
]
}
})
sliderChart_CS_Gasto_T_Salud_Hab_PPS.moveSeriesToFront(0)
/* Legendan klikatuta dauden serieen maximo eta minimoa eguneratzeko*/
leftSliderPos_CS_Gasto_T_Salud_Hab_PPS = ui.values[0]
rightSliderPos_CS_Gasto_T_Salud_Hab_PPS = ui.values[1]
seriesStringActual_CS_Gasto_T_Salud_Hab_PPS = getSeriesClickedOnLegend(this, seriesStringActual_CS_Gasto_T_Salud_Hab_PPS, seriesStringAll_CS_Gasto_T_Salud_Hab_PPS, mainChart_CS_Gasto_T_Salud_Hab_PPS)
seriesActual_CS_Gasto_T_Salud_Hab_PPS = getSeriesFromString(seriesStringActual_CS_Gasto_T_Salud_Hab_PPS, seriesAll_CS_Gasto_T_Salud_Hab_PPS)
allSeries_CS_Gasto_T_Salud_Hab_PPS = getAllValuesY(seriesActual_CS_Gasto_T_Salud_Hab_PPS,leftSliderPos_CS_Gasto_T_Salud_Hab_PPS,rightSliderPos_CS_Gasto_T_Salud_Hab_PPS)
minLegend_CS_Gasto_T_Salud_Hab_PPS = getSerieMin(allSeries_CS_Gasto_T_Salud_Hab_PPS)
maxLegend_CS_Gasto_T_Salud_Hab_PPS = getSerieMax(allSeries_CS_Gasto_T_Salud_Hab_PPS)
mainChart_CS_Gasto_T_Salud_Hab_PPS.axes.yaxis.ticks = getYRange(0.1, maxLegend_CS_Gasto_T_Salud_Hab_PPS)
mainChart_CS_Gasto_T_Salud_Hab_PPS.axes.y2axis.ticks = getYRange(0.1, maxLegend_CS_Gasto_T_Salud_Hab_PPS)
mainChart_CS_Gasto_T_Salud_Hab_PPS.replot();
}
});
/* */
function repaintLineWidth(serieId, eventType, mainChart, clicks, seriesWidth){
var series_CS_Gasto_T_Salud_Hab_PPS;
if (serieId == "serie1Name_CS_Gasto_T_Salud_Hab_PPS" && 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_CS_Gasto_T_Salud_Hab_PPS" && 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_CS_Gasto_T_Salud_Hab_PPS" && 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_CS_Gasto_T_Salud_Hab_PPS" && 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_CS_Gasto_T_Salud_Hab_PPS" && 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_CS_Gasto_T_Salud_Hab_PPS" && 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_CS_Gasto_T_Salud_Hab_PPS = [{lineWidth: seriesWidth[0]},{lineWidth: seriesWidth[1]},{lineWidth: seriesWidth[2]},{lineWidth: 0.01}]
return series_CS_Gasto_T_Salud_Hab_PPS;
}
/* Funtzio honek Legend-an klikaturik dauden serieen array-a itzultzen du eta seriea pintatu/ez pintatu */
function getSeriesClickedOnLegend(thisClicked, seriesActual, seriesAll, mainChart){
result_CS_Gasto_T_Salud_Hab_PPS = seriesActual
if(thisClicked.value=="s1_legend_CS_Gasto_T_Salud_Hab_PPS"){
index = indexOfSerieClicked(thisClicked.value, seriesActual)
if(thisClicked.checked == true){
result_CS_Gasto_T_Salud_Hab_PPS.splice(index, 0, seriesAll[0]);
}
else{
result_CS_Gasto_T_Salud_Hab_PPS.splice(index, 1);
}
mainChart.series[0].show = thisClicked.checked;
}
if(thisClicked.value=="s2_legend_CS_Gasto_T_Salud_Hab_PPS"){
index = indexOfSerieClicked(thisClicked.value, seriesActual)
if(thisClicked.checked == true){
result_CS_Gasto_T_Salud_Hab_PPS.splice(index, 0, seriesAll[1]);
}
else{
result_CS_Gasto_T_Salud_Hab_PPS.splice(index, 1);
}
mainChart.series[1].show = thisClicked.checked;
}
if(thisClicked.value=="s3_legend_CS_Gasto_T_Salud_Hab_PPS"){
index = indexOfSerieClicked(thisClicked.value, seriesActual)
if(thisClicked.checked == true){
result_CS_Gasto_T_Salud_Hab_PPS.splice(index, 0, seriesAll[2]);
}
else{
result_CS_Gasto_T_Salud_Hab_PPS.splice(index, 1);
}
mainChart.series[2].show = thisClicked.checked;
}
return result_CS_Gasto_T_Salud_Hab_PPS
}
});