| @@ -131,8 +131,20 @@ | ||
| 131 | 131 | } |
| 132 | 132 | } |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | + if(settings.hAxis){ | |
| 136 | + if(settings.hAxis.textStyle && settings.hAxis.textStyle != ''){ | |
| 137 | + settings.hAxis.textStyle = {color: settings.hAxis.textStyle}; | |
| 138 | + } | |
| 139 | + } | |
| 140 | + | |
| 141 | + if(settings.vAxis){ | |
| 142 | + if(settings.vAxis.textStyle && settings.vAxis.textStyle != ''){ | |
| 143 | + settings.vAxis.textStyle = {color: settings.vAxis.textStyle}; | |
| 144 | + } | |
| 145 | + } | |
| 146 | + | |
| 135 | 147 | for (i = 0; i < data.length; i++) { |
| 136 | 148 | row = []; |
| 137 | 149 | for (j = 0; j < series.length; j++) { |
| 138 | 150 | if (series[j].type == 'date' || series[j].type == 'datetime') { |
| @@ -197,6 +209,32 @@ | ||
| 197 | 209 | $(window).resize(function() { |
| 198 | 210 | clearTimeout(resizeTimeout); |
| 199 | 211 | resizeTimeout = setTimeout(v.render, 100); |
| 200 | 212 | }); |
| 201 | - }); | |
| 213 | + | |
| 214 | + resizeHiddenContainers(); | |
| 215 | + }); | |
| 216 | + | |
| 217 | + function resizeHiddenContainers(){ | |
| 218 | + $(".visualizer-front").parents().each(function(){ | |
| 219 | + if(!$(this).is(":visible")){ | |
| 220 | + $(this).addClass("visualizer-hidden-container"); | |
| 221 | + } | |
| 222 | + }); | |
| 223 | + | |
| 224 | + var mutateObserver = new MutationObserver(function(records) { | |
| 225 | + records.forEach(function(record) { | |
| 226 | + if(record.attributeName == "style"){ | |
| 227 | + var element = $(record.target); | |
| 228 | + var displayStyle = window.getComputedStyle(element[0]).getPropertyValue("display"); | |
| 229 | + if(element.hasClass("visualizer-hidden-container-resized") || displayStyle == "none") return; | |
| 230 | + element.addClass("visualizer-hidden-container-resized").find(".visualizer-front").resize(); | |
| 231 | + } | |
| 232 | + }); | |
| 233 | + }); | |
| 234 | + | |
| 235 | + $('.visualizer-hidden-container').each(function(){ | |
| 236 | + mutateObserver.observe($(this)[0], {attributes: true}); | |
| 237 | + }); | |
| 238 | + } | |
| 239 | + | |
| 202 | 240 | })(jQuery, visualizer); |