anychart.onDocumentReady(function () {
{x: "John Doe", value: 1},
{x: "Richard Roe", value: 1},
{x: "Larry Loe", value: 1},
{x: "Marta Moe", value: 1},
{x: "Jane Poe", value: 1},
{x: "Norma Noe", value: 1},
{x: "William Woe", value: 1}
newData = data.slice(0, 4);
chart = anychart.pie(newData);
chart.title("Legend: Size (Expandable)\n\n" +
"Max Height = 30%, Max Width = 50%");
chart.legend().maxHeight("30%");
chart.legend().maxWidth("50%");
chart.legend().itemsLayout("horizontal-expandable")
chart.container("container");
newData = newData.concat(data[newData.length]);
if (newData.length == data.length) {
document.getElementById("addItemButton").disabled = true;
document.getElementById("removeItemButton").disabled = false;
newData = newData.slice(0, newData.length - 1);
if (newData.length == 1) {
document.getElementById("removeItemButton").disabled = true;
document.getElementById("addItemButton").disabled = false;