Completo review pagine x gestioen report su pag diverse

This commit is contained in:
Samuele Locatelli
2024-03-20 07:18:34 +01:00
parent 1d3ef90402
commit 2d7cbf7d60
17 changed files with 131 additions and 362 deletions
+27 -16
View File
@@ -24,7 +24,7 @@
var labelsTS = dataTS.map(function (item) {
return item['x'];
});
//console.log('labels data', labels);
//console.log('labels data', labelsTS);
var myOptions = {
responsive: true,
@@ -42,15 +42,17 @@
};
// recupero obj chart
//console.log('ctx ID: ', document.getElementById('myChartTS'));
var ctx = document.getElementById('myChartTS').getContext('2d');
var sLeg = document.getElementById('<%=hfLegend.ClientID %>').value;
var chart = new Chart(ctx, {
type: 'line',
data: {
labels: labelsTS,
datasets: [{
label: '<%=hfLegend.Value %>',
label: sLeg,
borderColor: 'rgb(7, 173, 236)',
lineTension: 0,
//steppedLine: false,
@@ -66,22 +68,31 @@
}
// effettuo plotting grafico TimeSerie!
function plotTS() {
//console.log("api/BatchStats/<%=hfShowLast.Value %>?PlotType=<%=hfPlotType.Value%>");
// caricamento pagina
$.ajax({
type: "GET",
url: "../api/BatchStats/<%=hfShowLast.Value %>?PlotType=<%=hfPlotType.Value%>",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: OnSuccess_,
error: OnErrorCall_
});
var hfSL = document.getElementById('<%=hfShowLast.ClientID %>');
if (hfSL != null) {
var lastNum = document.getElementById('<%=hfShowLast.ClientID %>').value ?? "";
var plotType = document.getElementById('<%=hfPlotType.ClientID %>').value ?? "";
//console.log("../api/BatchStats/"+lastNum+"?PlotType="+plotType);
// caricamento pagina
$.ajax({
type: "GET",
url: "../api/BatchStats/" + lastNum + "?PlotType=" + plotType,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: OnSuccess_,
error: OnErrorCall_
});
}
}
// funzione di drawing ad OGNI pageload!
function pageLoad() {
// chiamo recupero dati + plot della TS
plotTS();
//console.log('pageLoad!');
try {
console.log('pageLoad BatchStats! | ID: <%= this.ID %> ');
plotTS();
}
catch (error) {
console.log(error);
}
}
</script>
</script>