I've got a function changeGraph() inside the jQuery-wrapper which I need to call somehow from outside it. I need to access the function setData from the jQuery based graph-library Flot.
The source is looking like this:
function changeGraph(){
    // I need to access $.plot.setData somehow
};  
var d2 = [[0, 0], [20, 300000]];
$(function () {              
    $.plot($("#placeholder"), 
    [{color: "#000000", data: d2}],
    {
    series: {
        lines: { show: true, fill:true, fillColor: {colors: [ "#d1ddea","#8e959d"]}},
        points: { show: false }
          }
       }
    );
});
How can I accomplish this?
var changeGraph;
$(function () {
    changeGraph = function () {
        // Need to access $.plot($("#placeholder") here
    };
});
changeGraph(); // call this when document is ready at least
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With