anychart.onDocumentReady(function() {
var chart = anychart.line(data);
chart.title("Export configuration sample");
chart.container("container");
chart.bounds(0, 0, chart.container().width()-35, chart.container().height());
var xmlButton = document.createElement("div");
var jsonButton = document.createElement("div");
xmlButton.className = "custombutton";
jsonButton.className = "custombutton";
xmlButton.innerHTML = "XML";
jsonButton.innerHTML = "JSON";
xmlButton.onclick = function() {
chart.saveAsXml(true, "pancakes_data");
jsonButton.onclick = function() {
chart.saveAsJson(true, "pancakes_data");
container.appendChild(xmlButton);
container.appendChild(jsonButton);
var custombuttons = document.getElementsByClassName("custombutton");
for (var i = 0; i<custombuttons.length; i++){
custombuttons[i].style.top = 45*i + "px";
custombuttons[i].style.right = "5px";
custombuttons[i].style.width = "50px";
custombuttons[i].style.height = "auto";
custombuttons[i].style.backgroundColor = "#444444";
custombuttons[i].style.color = "white";
custombuttons[i].style.fontFamily = chart.title().fontFamily();
custombuttons[i].style.position = "absolute";
custombuttons[i].style.zIndex = 2;
custombuttons[i].style.transition = "0.5s";
custombuttons[i].style.textAlign = "center";
custombuttons[i].style.border = "3px solid #444444";
custombuttons[i].style.borderRadius = "7px 7px 7px 7px";
custombuttons[i].style.fontSize = "18px";
custombuttons[i].style.cursor = "pointer";