* ---------------------------------------
* This demo was created using amCharts 5.
* For more information visit:
* https://www.amcharts.com/
* Documentation is available at:
* https://www.amcharts.com/docs/v5/
* ---------------------------------------
// https://www.amcharts.com/docs/v5/getting-started/#Root_element
var root = am5.Root.new("chartdiv");
// https://www.amcharts.com/docs/v5/concepts/themes/
root.setThemes([am5themes_Animated.new(root)]);
// https://www.amcharts.com/docs/v5/charts/word-cloud/
var series = root.container.children.push(
am5wc.WordCloud.new(root, {
maxFontSize: am5.percent(35),
text: "One Two Two Three Three Three Four Four Four Four"
series.labels.template.setAll({
fontFamily: "Courier New"
var button = root.container.children.push(
label: am5.Label.new(root, {
button.events.on("click", function () {
series.data.push({ category: "Five", value: 5 });