Skip to content

Commit 9be22fb

Browse files
authored
Bug Fix: Changed positioning of button
1 parent f62c11e commit 9be22fb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/CanvasJS As CSV.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ function CanvasJSDataAsCSV(chart, fileName) {
2121
toolBar.lastChild.appendChild(exportCSV);
2222
} else {
2323
var base64Img = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAEgSURBVEhL3dM/SgNBFMfxBS8gWkYb0dJSyBGCwdIzRPAKgrZKINdIkVJB0qqteIdYCYoHEPX74P1gMszuzG5SiD/4wM6/99jJpvq3GeIVPwUu0ToLpIrVad1EB3Pp3KRLA1PcRAdyCYtLURNtziUsHMqmeGOUxnNtPs2cZNp+mk2S0eIteu7O5y5wgFN8Yw8vePZnnZVktLiDJzxi1+cOfe4GHxhhgjHOoLOSTLgYbjZz7OPaxzOc4Nif4/3JaNHe4MHpDc7xiW284R1b2IS9ka61MWpg925NrPi9z9mfx65pgC+fO0Lfn21/Nqt8RUo8XordZ9cmSjyuTfHGKH+nQe6qptiA5QqpPcbWkin5PXJNaot3Tdhk7cUVKxwUr6pfwprgQh4A9MYAAAAASUVORK5CYII=";
24-
var exportButton = document.createElement('button');
25-
var chartBound = chart.container.getBoundingClientRect();
26-
exportButton.style.cssText = "position:absolute;display: inline-block;padding: 0px 4px;height: 27px;cursor: pointer;text-align: center;text-decoration: none;background-color: #fff;border: 1px solid rgb(33, 150, 243);left:" + (chartBound.right - (chart.options.zoomEnabled ? 115 : 60)) + "px; top:" + (chartBound.top + 2) + "px";
24+
var exportButton = document.createElement('button');
25+
26+
exportButton.style.cssText = "position:relative;display: inline-block;padding: 0px 4px;height: 27px;cursor: pointer;text-align: center;text-decoration: none;background-color: #fff;border: 1px solid rgb(33, 150, 243);left:" + (chart.container.clientWidth - (chart.options.zoomEnabled ? 115 : 60)) + "px; top: 1px";
2727

2828
var img = document.createElement("IMG");
2929
img.setAttribute("src", base64Img);
@@ -41,7 +41,7 @@ function CanvasJSDataAsCSV(chart, fileName) {
4141
})
4242
});
4343

44-
chart.container.parentNode.insertBefore(exportButton, chart.container.nextSibling);
44+
chart.container.appendChild(exportButton);
4545
}
4646
}
4747

0 commit comments

Comments
 (0)