<div id="container"></div>
html, body, #container {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
// create data
var data = [
{x: "learning", value: 80},
{x: "includes", value: 56},
{x: "lists", value: 44},
{x: "meaning", value: 40},
{x: "useful", value: 36},
{x: "different", value: 32}
];
// create a chart and set the data
var chart = anychart.tagCloud(data);
// set the chart title
chart.title("Tag Cloud Chart: Basic Sample");
// set the container id
chart.container("container");
// initiate drawing the chart
chart.draw();
// update data in 1.5 sec
setTimeout(function() {
// declare new data
var newData = [
{x: "ASP.NET", value: 80},
{x: "Java", value: 56},
{x: "NodeJS", value: 44},
{x: "Perl", value: 40},
{x: "Python", value: 36}
// apply to the existing chart
chart.data(newData);
}, 1500);