Hocam kodlar şu şekilde. Dediğinizi yaptım fakat çalışmadı. Bir kaç yol denedim ama beceremedim.
[CODE title="Google charts/çizelge" highlight="26, 27, 28, 29"]<script type="text/javascript">
// Load the Visualization API and the corechart package.
google.charts.load('current', { 'packages': ['corechart'] });
// Set a callback to run when the Google Visualization API is loaded.
google.charts.setOnLoadCallback(drawChart);
// Callback that creates and populates a data table,
// instantiates the pie chart, passes in the data and
// draws it.
function drawChart() {
// Create the data table.
var data = new google.visualization.DataTable();
data.addColumn('string', 'Topping');
data.addColumn('number', 'Slices');
data.addRows([
@{
string koseliparantezsol = "[";
string koseliparantezsag = "]";
string virgul = ",";
string tirnak = "'";
foreach (var item in urunkategori)
{
string yaz = koseliparantezsol + tirnak + item.KategoriAdi + tirnak + virgul + item.Urunler.Count() + koseliparantezsag + virgul;
@yaz
}
}
]);
// Set chart options
var options = {
'title': 'ANLIK AKTİF İŞ TOPLAMI',
'width': 400,
'height': 300,
'is3D': true,
};
// Instantiate and draw our chart, passing in some options.
var chart = new google.visualization.PieChart(document.getElementById('chart_div_2'));
chart.draw(data, options);
}
</script>[/CODE]