Skip to content

Commit 5457824

Browse files
committed
Updated background-color properties as per latest update of CanvasJS
1 parent b9133b8 commit 5457824

File tree

3 files changed

+11
-23
lines changed

3 files changed

+11
-23
lines changed

dist/canvasjsascsv.min.js

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

index.html

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -182,19 +182,7 @@
182182

183183
<body>
184184
<h1 id="exportcanvasjschartdataascsv">Export CanvasJS Chart Data as CSV</h1>
185-
<p>This plugin allows you to export and save CanvasJS Chart's data as CSV. Check out <a href="https://github.com/vishwas-r/Export-CanvasJS-Chart-Data-as-CSV">Github Repository</a> for more info / examples.</p>
186-
<h2 id="canvasjs">CanvasJS</h2>
187-
<p>CanvasJS is an HTML5 &amp; JavaScript based Charting Library that runs on all modern devices including iPhone, Android, Desktops, etc. Charts are beautiful and API is very simple to use.</p>
188-
<h4 id="canvasjsfeatures">CanvasJS Features:</h4>
189-
<ul>
190-
<li>Simple API and easy to use</li>
191-
<li>Supports 30+ different types of Charts / Graphs</li>
192-
<li>10x faster than conventional Flash / SVG based Charting Libraries</li>
193-
<li>Comes with Several beautiful looking themes</li>
194-
<li>Well Maintained and Updated Documentation</li>
195-
<li>Works across browsers (Chrome, Firefox, Safari, IE8+)</li>
196-
<li>Can be integrated with Serverside and Frontend technologies like ASP.Net, PHP, Spring MVC, JSP, jQuery, Angular, React, etc.</li>
197-
</ul>
185+
<p>This plugin allows you to export and save <a href="https://canvasjs.com/" target="_blank">CanvasJS</a> Chart's data as CSV. Check out <a href="https://github.com/vishwas-r/Export-CanvasJS-Chart-Data-as-CSV">Github Repository</a> for more info / examples.</p>
198186
<h4 id="howtouse">How to Use?</h4>
199187
<ul>
200188
<li>Create and Render CanvasJS Chart</li>

src/CanvasJS As CSV.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ function CanvasJSDataAsCSV(chart, fileName) {
1010
if (chart.exportEnabled) {
1111
var exportCSV = document.createElement('div');
1212
var text = document.createTextNode("Save as CSV");
13-
exportCSV.setAttribute("style", "padding: 12px 8px; background-color: " + chart.toolbar.backgroundColor + "; color: " + chart.toolbar.fontColor);
13+
exportCSV.setAttribute("style", "padding: 12px 8px; background-color: " + chart.toolbar.itemBackgroundColor + "; color: " + chart.toolbar.fontColor);
1414
exportCSV.appendChild(text);
1515
exportCSV.addEventListener("mouseover", function () {
16-
exportCSV.setAttribute("style", "padding: 12px 8px; background-color: " + chart.toolbar.backgroundColorOnHover + "; color: " + chart.toolbar.fontColorOnHover);
16+
exportCSV.setAttribute("style", "padding: 12px 8px; background-color: " + chart.toolbar.itemBackgroundColorOnHover + "; color: " + chart.toolbar.fontColorOnHover);
1717
});
1818
exportCSV.addEventListener("mouseout", function () {
19-
exportCSV.setAttribute("style", "padding: 12px 8px; background-color: " + chart.toolbar.backgroundColor + "; color: " + chart.toolbar.fontColor);
19+
exportCSV.setAttribute("style", "padding: 12px 8px; background-color: " + chart.toolbar.itemBackgroundColor + "; color: " + chart.toolbar.fontColor);
2020
});
2121
exportCSV.addEventListener("click", function () {
2222
parseCSV({
@@ -30,16 +30,16 @@ function CanvasJSDataAsCSV(chart, fileName) {
3030
var base64Img = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAEgSURBVEhL3dM/SgNBFMfxBS8gWkYb0dJSyBGCwdIzRPAKgrZKINdIkVJB0qqteIdYCYoHEPX74P1gMszuzG5SiD/4wM6/99jJpvq3GeIVPwUu0ToLpIrVad1EB3Pp3KRLA1PcRAdyCYtLURNtziUsHMqmeGOUxnNtPs2cZNp+mk2S0eIteu7O5y5wgFN8Yw8vePZnnZVktLiDJzxi1+cOfe4GHxhhgjHOoLOSTLgYbjZz7OPaxzOc4Nif4/3JaNHe4MHpDc7xiW284R1b2IS9ka61MWpg925NrPi9z9mfx65pgC+fO0Lfn21/Nqt8RUo8XordZ9cmSjyuTfHGKH+nQe6qptiA5QqpPcbWkin5PXJNaot3Tdhk7cUVKxwUr6pfwprgQh4A9MYAAAAASUVORK5CYII=";
3131
var exportButton = document.createElement('button');
3232

33-
exportButton.style.cssText = "position:relative;display: inline-block;padding: 0px 4px;height: 27px;cursor: pointer;text-align: center;text-decoration: none;background-color:" + chart.toolbar.backgroundColor + ";border: 1px solid " + chart.toolbar.borderColor + ";left:" + (chart.container.clientWidth - (chart.options.zoomEnabled ? 115 : 60)) + "px; top: 1px";
33+
exportButton.style.cssText = "position:relative;display: inline-block;padding: 0px 4px;height: 27px;cursor: pointer;text-align: center;text-decoration: none;background-color:" + chart.toolbar.itemBackgroundColor + ";border: 1px solid " + chart.toolbar.borderColor + ";left:" + (chart.container.clientWidth - (chart.options.zoomEnabled ? 115 : 60)) + "px; top: 1px";
3434

3535
var img = document.createElement("IMG");
3636
img.setAttribute("src", base64Img);
3737
exportButton.appendChild(img);
3838
exportButton.addEventListener("mouseover", function () {
39-
this.style.cssText = this.style.cssText + "background-color: " + chart.toolbar.backgroundColorOnHover;
39+
this.style.cssText = this.style.cssText + "background-color: " + chart.toolbar.itemBackgroundColorOnHover;
4040
});
4141
exportButton.addEventListener("mouseout", function () {
42-
this.style.cssText = this.style.cssText + "background-color: " + chart.toolbar.backgroundColor;
42+
this.style.cssText = this.style.cssText + "background-color: " + chart.toolbar.itemBackgroundColor;
4343
});
4444
exportButton.addEventListener("click", function () {
4545
parseCSV({

0 commit comments

Comments
 (0)