Salve a tutti, non s� se questo � il gruppo giusto oppure devo spostarlo nella sessione ASP.
Comunque io vi posto il mio problema e spero che qualcuno mi possa aiutare. Io voglio creare un grafico a linee prendendo i dati da una query, quindi dati dinamici, sull'asse delle ascisse vorrei le date mentre sull'asse delle ordinate i valori di alcune misurazioni.
Di seguito il codice:
codice:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<htmlxmlns="http://www.w3.org/1999/xhtml">
<head>
<metahttp-equiv="Content-Type"content="text/html; charset=utf-8"/>
<scripttype="text/javascript"src="https://www.gstatic.com/charts/loader.js"></script>
<scripttype="text/javascript"src="Chart.js"></script>
<title>TEAM-GEST: SOFTWARE PROFESSIONALE PER GESTIRE IL TUO TEAM</title>
<linkhref="stile.css"rel="stylesheet"type="text/css"/>
<linkrel="icon"href="/images/logo1.ico"/>
</head>


<body>
<%
session
("StagioneAttuale")
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 or rs.bof) then


Set rsAssenti = Server.CreateObject("adodb.recordset")
rsAssenti.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 & "' group by DataInsert", Conn,3,3
rsAssenti.movefirst


while not rsAssenti.eof
ValoreAssenti = rsAssenti("ConteggioMotivo")
DataAssenti = rsAssenti("DataInsert")


TotaleAssenti = ValoreAssenti
TotaleGiocatori = rs.recordcount
PercentualeAssenti = Round((TotaleAssenti * 100)/TotaleGiocatori,0)
%>
<canvasid="myLineChart"width="800"height="400"></canvas>

<scripttype="text/javascript">
// Definisco i dati da mostrare nel grafico
var data ={

labels
:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto"],
datasets
:[
{
label
:"Mesi",
fillColor
:"rgba(99,240,220,0.2)",
strokeColor
:"rgba(99,240,220,1)",
pointColor
:"rgba(99,240,220,1)",
pointStrokeColor
:"#fff",
pointHighlightFill
:"#fff",
pointHighlightStroke
:"rgba(220,220,220,1)",
data
:[<%=DataAssenti%>]

},
{
label
:"Temperature 2014",
fillColor
:"rgba(205,99,151,0.2)",
strokeColor
:"rgba(205,99,151,1)",
pointColor
:"rgba(205,99,151,1)",
pointStrokeColor
:"#fff",
pointHighlightFill
:"#fff",
pointHighlightStroke
:"rgba(151,187,205,1)",
data
:[<%=TotaleAssenti%>]

}
]
};
<%
rsAssenti
.movenext
wend
%>
// 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 =newChart(ctx).Line(data);


</script>
<divid="myLineChart"></div>


<%else%>
<scripttype="text/javascript">
<!--window.close()-->
</script>
<%endif%>
</body>
</html>