codice:
<canvas id="myChart" width="700" height="500"></canvas>
<script>
// Definisco i dati da mostrare nel grafico
var data = {
<% Response.Write("labels: [")
while not rsPresentiGennaio.eof
Response.Write(""&Chr(34)&""&rsPresentiGennaio("DataInsert")&""&Chr(34)&",")
rsPresentiGennaio.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: "rgba(220,220,220,1)",
//data: [1, 1, 2, 2, 2, 2, 2, 2, 2]
<% rsPresentiGennaio.movefirst
Response.Write("data: [")
while not rsPresentiGennaio.eof
Response.Write(""&rsPresentiGennaio("ConteggioMotivo")&",")
rsPresentiGennaio.movenext
wend
Response.Write("]")
%>
}
]
};
var options = {
'title':'VERIFICHE',
'titleTextStyle':{color: 'white', fontName: 'Trebuchet MS', fontSize: 20},
backgroundColor:'#7A8996',
'chartArea':{left:20,top:150,width:'100%',height:'100%'},
fontSize:16,
fontname:'Trebuchet MS',
legend:{position: 'right', textStyle:{color: 'white', fontName: 'Trebuchet MS', fontSize: 16}},
};
// Ottengo il contesto 2D del Canvas in cui mostrare il grafico
var ctx = document.getElementById("myChart").getContext("2d");
// Crea il grafico e visualizza i dati
var myNewChart = new Chart(ctx);
//myNewChart.Bar(data);
myNewChart.Line(data,options);
</script>