Merged #103 "flotr2 throws exception on small dashboards"
| | |
| | | StringBuilder sb = new StringBuilder(); |
| | | |
| | | line(sb, "$( document ).ready(function() {"); |
| | | line(sb, "try {"); |
| | | // add charts to header |
| | | for (Chart chart : charts) { |
| | | chart.appendChart(sb); |
| | | } |
| | | |
| | | line(sb, "} catch (exception) {"); |
| | | line(sb, " if (window.console && window.console.log) {"); |
| | | line(sb, " window.console.log('flotr2 exception');"); |
| | | line(sb, " window.console.log(exception);"); |
| | | line(sb, " }"); |
| | | line(sb, "}"); |
| | | // end draw chart function |
| | | line(sb, "});"); |
| | | response.renderJavascript(sb.toString(), null); |