Skip to content

Commit fa2dc5a

Browse files
committed
Improved positioning of 'Export' button when zooming is enabled
1 parent 8843aa6 commit fa2dc5a

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

dist/canvasjsasjson.min.js

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/CanvasJS Data As JSON.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ 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: 5px 15px;cursor: pointer;text-align: center;text-decoration: none;background-color: #f4511e;border: none;border-radius: 10px;left:" + (chartBound.right - 60) + "px; top:" + chartBound.top + "px";
27+
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";
2828
var img = document.createElement("IMG");
2929
img.setAttribute("src", base64Img);
3030
exportButton.appendChild(img);
3131
exportButton.addEventListener("mouseover", function() {
32-
this.style.cssText = this.style.cssText + "background-color: #d4511e;";
32+
this.style.cssText = this.style.cssText + "background-color: rgb(33, 150, 243)";
3333
});
3434
exportButton.addEventListener("mouseout", function() {
35-
this.style.cssText = this.style.cssText + "background-color: #f4511e;";
35+
this.style.cssText = this.style.cssText + "background-color: #fff;";
3636
});
3737
exportButton.addEventListener("click", function() {
3838
downloadJSON({

0 commit comments

Comments
 (0)