Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • in reply to: Zooming on graph changes it to another graph. #17278

    Thank you so much @indranil!

    I was really stumped at this one. Tried all sorts of things with no luck. It was so strange and annoying to me that it worked fine when messily duplicated three times in each chart constructor but not neatly one time from a variable.

    Your links and jsfiddle were very helpful. Once I knew I needed to somehow copy the object without the reference. Finding a solution in a compact form, which I was now obsessive about, took no time at all lol.

    This is what I’ve ended up doing:

    Before the construction of each chart, I simply do:
    var defaults_<name> = jQuery.extend(true, {}, chart_defaults);
    And then I construct with defaults_<name> instead of chart_defaults.

    According to this question and answer on stack overflow where I learned the function It’s known as deep cloning a javascript object.

    So now any additions or changes stay isolated to that chart as they should. Yey! =)

    Full page’s code for anyone that may be interested in more context to the solution.

    Ah I see. I thought I should ask just in case. I’ve changed it to:
    #downUpContainer, #pingsContainer {height: 520px; width: 100%;}
    and it works fine.

    Thank you for your help. =)

    Thank you so much!

    How strange that setting the container div sizes in the head section breaks interactivity. I take it thats a bug?

    And thanks for showing me how to get it working on jsFiddle. I see now that trying to add document.ready to the javascript was what was causing it to break.

    Should I now create a bug report?

Viewing 3 posts - 1 through 3 (of 3 total)