I'm facing problem in binding google chart with database.
<script type="text/javascript">
google.charts.load("current", { packages: ["corechart"] });
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
data = new google.visualization.DataTable();
data.addColumn('string', 'Topping');
data.addColumn('number', 'Slices');
data.addRows([
['Onions', 1],
['Olives', 1],
['Zucchini', 1],
['Pepperoni', 2],
]);
var options = {
title: '',
pieHole: 0.4,
};
var chart = new google.visualization.PieChart(document.getElementById('donutchart'));
chart.draw(data, options);
}
</script>
Manish Kumar
15-Dec-2017You can bind google chart with viewbag data..