Skip to content

Commit dfe57ad

Browse files
authored
Bug Fix: Changed export button positioning
Changed export button positioning when exportEnabled is set to false
1 parent 9ac592a commit dfe57ad

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/CanvasJS Data As JSON.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function CanvasJSDataAsJSON(chart, fileName) {
2424
var exportButton = document.createElement('button');
2525
var chartBound = chart.container.getBoundingClientRect();
2626

27-
exportButton.style.cssText = "position:absolute;display: inline-block;padding: 0px 4px;width: 35px;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";
27+
exportButton.style.cssText = "position:absolute;display: inline-block;padding: 0px 4px;width: 35px;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";
2828
var img = document.createElement("IMG");
2929
img.setAttribute("src", base64Img);
3030
exportButton.appendChild(img);
@@ -41,7 +41,7 @@ function CanvasJSDataAsJSON(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)