I have a graphical counter that is fed by JSON what I wanted to err generate dynamically houses ie having a number of elements stipulated by a variable.
Example of what I tried to do:
<script type="text/javascript">
// Get the context of the canvas element we want to select
var ctx = document.getElementById("piechart").getContext("2d");
var data = [
while(i=2)
{
{
value: <?print $valor;?>,
color:"#F7464A",
highlight: "#FF5A5E",
label: "Red"
},
i++;
}
];
var options = {
animateScale: true
};
var myNewChart = new Chart(ctx).Pie(data,options);