Visualization of data is very critical while analyzing any data set. It helps us understand and observe the data more effectively than simply having to stare at rows of observations of different parameters. Sometimes, we even get to notice the obvious by just looking at a meaningful graphical depiction rather than just the data.
    Here we go one step further from creating vizualizations through a software to interactive ones depicted online. We begin by creating a very simple Donut chart to visualize some data.
All we need to do is copy the code below to any text editor, make the necessary changes in the data and paste it in our blog. It works just like this example.==============================================================================
<html>
<head>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Activities', 'Hours per Day'],
['Work', 6],
['Eat', 2],
['Commute', 3],
['Read books/articles', 3],
['Listen to music/Watch movies', 2],
['Sleep', 8]
]);
var options = {
title: 'My Daily Activities',
pieHole: 0.4,
};
var chart = new google.visualization.PieChart(document.getElementById('donutchart'));
chart.draw(data, options);
}
</script>
</head>
</html>
No comments:
Post a Comment