0

I've seen similar questions about this topic but never seen this happen in Firefox. I'm using Firefox 49.0.2 on a modern mac running Yosemite.

My code that I just added which is holding up until I open the Developer Console:

            var jsonSeries = [];
            $.ajax({
                url: 'https://api.simplymeasured.com/v1/analytics/<account-id>/profiles/metrics?filter=profile.id.eq(<numbers>)&filter=analytics.timeseries_key.gt(2016-10-01)&dimensions=analytics.timeseries_key.by(day)',
                headers: {
                    'Authorization': 'Bearer <a long key>',
                    'Content': 'application/json',
                    'Cache-Control': 'no-cache, no-store'
                    },
                type: 'GET',
                dataType: 'json',
            }).done(function(json) {
                for (var i = 0; i < json.data.length; i++) {
                    jsonSeries.push(json.data[i]['attributes']['metrics']["analytics.audience_count"]);
                }
            });

            var dataCT = {
              labels: ['W1', 'W2', 'W3', 'W4', 'W5', 'W6', 'W7', 'W8', 'W9', 'W10'],
              series: [
                jsonSeries
              ]
            };

            var optionsCT = {
              axisX: {
                labelInterpolationFnc: function(value, index) {
                  return index % 2 === 0 ? value : null;
                }
              }
            };

            new Chartist.Bar('.ct-chart', dataCT, optionsCT);

The chart initialized afterwards even loads fine, it's just empty. Even if my Developer Console is open initially, the actual data won't appear until I simply resize the Developer Console. It seems like any trigger or action on the Developer Console will bring in the data.


With developer console initially open, reloading the page, even waited 10+ seconds just in case: ajax data not working until developer console resized


After resizing developer console only a few pixels: after resizing developer console - ajax jquery

Community
  • 1
  • 1
qarthandso
  • 2,100
  • 2
  • 24
  • 40
  • 2
    out of curiosity is this happening only when console is opened/resized or the window too? Opening/resizing the console technically triggers this same event. Perhaps it's something to do with some rendering that only happens on window resize. – Corvus Crypto Nov 13 '16 at 21:32
  • It's the window too... didn't even think about. That opens up quite a few more places it could have gone wrong. Without knowing my code, is there some key things I should be looking for? – qarthandso Nov 13 '16 at 21:34
  • 1
    I can't see the whole code, but I would start looking for "resize" event listeners. Other than that I'd be as lost as you man. sorry :( Actually... is there an event you can manually trigger when the ajax update is done that three.js recognizes? – Corvus Crypto Nov 13 '16 at 21:35

0 Answers0