I'm creating a google chart and I have now made it look like I want it to with amounts of lines/bars and multiple axises and so on, now I want to have dynamic data inside of it.
function drawVisualization()
{
// Some raw data (not necessarily accurate)
var data = google.visualization.arrayToDataTable([
['Day', 'KG', 'Average', 'peak'],
['1', 22000, 70, 90],
['2', 21000, 80, 87],
['3', 19000, 75, 79],
['4', 25000, 60, 88],
['5', 24000, 90, 95]
]);
So as of right now this is how the data is sent to the chart, 1,2,3,4,5 for hAxis and the rest for vAxis.
However I thought I could use a foreach in here and do something like this to return data:
@foreach (var c in db.Query(getWorkout))
{
['1', @c.kg, @c.rep, @c.sett];
}
The foreach actually works while no code is inside it so I guess the errors are all due to ['1', @c.kg, @c.rep, @c.sett]; this.
Anyone got any ideas of what to do? Would be tremendously thankful!