Ciao a tutti, sono arrivato ad un punto abbastanza avanti, per non dire che ho quasi finito, ma adesso il problema è che non stampa i dati.
Questo il codice:
codice:
<HTML>
<HEAD>
<title>TEAM-GEST: SOFTWARE PROFESSIONALE PER GESTIRE IL TUO TEAM</title>
<link href="stile.css" rel="stylesheet" type="text/css" />
<link rel="icon" href="/images/logo1.ico" />
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript" src="Chart.js"></script>
<%
Categoria = request.form("Categoria")
' stringa di conn
Set Conn = Server.CreateObject("ADODB.Connection")
Connect = "Driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath(""& session("MM_Percorso") &"")
Conn.Open Connect
Set rs = Server.CreateObject("adodb.recordset")
rs.Open "SELECT * FROM T_Presenze_Assenze"&session("StagioneAttuale")&" where Categoria='" & Categoria & "'", Conn,3,3
if not rs.eof then
Gennaio = 01
Febbraio = 02
Set rsAssentiGennaio = Server.CreateObject("adodb.recordset")
rsAssentiGennaio.Open "SELECT DISTINCT count([T_Presenze_Assenze"&session("StagioneAttuale")&"].Motivo) as ConteggioMotivo, DataInsert FROM T_Presenze_Assenze"&session("StagioneAttuale")&" where Motivo <= '5' and Categoria='" & Categoria & "' and (((Month([DataInsert]))='" & Gennaio & "')) group by DataInsert", Conn,3,3
Set rsAssentiFebbraio = Server.CreateObject("adodb.recordset")
rsAssentiFebbraio.Open "SELECT DISTINCT count([T_Presenze_Assenze"&session("StagioneAttuale")&"].Motivo) as ConteggioMotivo, DataInsert FROM T_Presenze_Assenze"&session("StagioneAttuale")&" where Motivo <= '5' and Categoria='" & Categoria & "' and (((Month([DataInsert]))='" & Febbraio & "')) group by DataInsert", Conn,3,3
%>
</HEAD>
<body bgcolor="#7A8996">
<canvas id="myLineChart" width="800" height="600"></canvas>
<script>
// Definisco i dati da mostrare nel grafico
var data = {
<% 'Response.Write("labels: [")
'while not rsAssentiGennaio.eof
'Response.Write(""&Chr(34)&""&rsAssentiGennaio("DataInsert")&""&Chr(34)&",")
'rsAssentiGennaio.movenext
'wend
'Response.Write("],")
%>
datasets: [
{
label: "Temperature 2013",
fillColor: "rgba(99,240,220,0.2)",
strokeColor: "rgba(99,240,220,1)",
pointColor: "rgba(99,240,220,1)",
pointStrokeColor: "#fff",
pointHighlightFill: "#fff",
pointHighlightStroke: "#fff",
//data: [8, 11, 18, 22, 24, 26, 34, 39, 31]
<% 'rsAssentiGennaio.movefirst
'Response.Write("data: [")
'while not rsAssentiGenaio.eof
'Response.Write(""&rsAssentiGennaio("ConteggioMotivo")&",")
'rsAssentiGennaio.movenext
'wend
'Response.Write("]")
%>
}
]
};
// Ottengo il contesto 2D del Canvas in cui mostrare il grafico
var ctx = document.getElementById("myLineChart").getContext("2d");
// Crea il grafico e visualizza i dati
var myLineChart = new Chart(ctx).Line(data);
</script>
Grazie