Google Charts - Styling Word Tree Chart
You are Here:
How to Draw a Styling Word Tree Chart?
Please wait google chart is loading...
In this example, we will draw a styling word tree chart. Please hover the words in the above chart to view particular details.
Example
HTML Online Editor
<!DOCTYPE html>
<html lang="en-US">
<head>
<script src="https://www.gstatic.com/charts/loader.js"></script>
</head>
<body>
<div id="point">
</div>
<script>
google.charts.load('current', {packages:['wordtree']});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable(
[ ['Phrases', 'size', 'value'],
['Dogs are friendly', 1, 4],
['Dogs are lovely', 1, 3],
['Dogs are security guard', 1, 7],
['Dogs are better than cats', 2, 8],
['Dogs eats bone', 1, 5],
['Dogs love playing', 2, 4],
['Dogs love kids', 2, 6],
['Dogs are sometimes dangerous', 2, 7],
['Dogs eats Cheese', 2, 9]
]);
var options = {
height: 400,
width: 600,
colors: ['red', 'black', 'green'],
wordtree: {
format: 'implicit',
word: 'Dogs'
}
};
var chart = new google.visualization.WordTree(document.getElementById('point'));
chart.draw(data, options);
}
</script>
</body>
</html>
Reminder
Hi Developers, we almost covered 98% of Google Charts Tutorials with examples for quick and easy learning.
We are working to cover every Single Concept in Google Charts.
Please do google search for:
Join Our Channel
Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.
This channel is primarily useful for Full Stack Web Developer.