Hello,
I'm trying to implement a dynamic chart on a custom page, but i don't really have so much clues about how to do it without the <xen:foreach>.
Basically i have an array from my model which has some integers, and i need to parse them on this way:
<xen:foreach loop="$loops" value="$loop" i="$i">
[{$i}, {$loop.a}, {$loop.b}, {$loop.c}]
</xen:foreach>
Of course on the template works great ([0,x,y,z], [1,x1, x2, x3], ...) but i need to build/read it inside the javascript script, and the template syntax doesn't work inside javascript.
Basically i need to get this inside the javascript to build the chart.
<script type="text/javascript">
data.addRows([ [0,x,y,z], [1,x1, x2, x3], ... ]);
</script>
How can i do it?
I'm trying to implement a dynamic chart on a custom page, but i don't really have so much clues about how to do it without the <xen:foreach>.
Basically i have an array from my model which has some integers, and i need to parse them on this way:
<xen:foreach loop="$loops" value="$loop" i="$i">
[{$i}, {$loop.a}, {$loop.b}, {$loop.c}]
</xen:foreach>
Of course on the template works great ([0,x,y,z], [1,x1, x2, x3], ...) but i need to build/read it inside the javascript script, and the template syntax doesn't work inside javascript.
Basically i need to get this inside the javascript to build the chart.
<script type="text/javascript">
data.addRows([ [0,x,y,z], [1,x1, x2, x3], ... ]);
</script>
How can i do it?