xsanisty/calx.js

Series and Graphing?

Closed this issue · 4 comments

Do you have an example of producing a series of results? I tried to adapt the dynamic example, but I need the opposite. One formula to loop though a series of answers and display rows. I was able to hard code the results but I would like it to be dynamic.

Then any ideas on how to get the same data and pass it to a chart plug-in to make a graph over time?

Hi bwente, may I know what chart plugin do you use?

Lol. I haven't picked one yet. I was going to see which one worked best with your plug-in.

I was looking at flot and jqplot.

On Oct 29, 2013, at 10:18 AM, Ikhsan Agustian notifications@github.com wrote:

Hi bwente, may I know what chart plugin do you use?


Reply to this email directly or view it on GitHub.

ok, let me build an example with those two chart plugin :)

--edit--
just add onupdate callback to the config section which will receive object with list of cell in format { "id" : "value" } pair

{
    A1 : 86.12,
    A2 : 37.86.
    A3 : 45.23
    //........//
}

so you can process the data to be displayed by the graph or chart plugin

    $('#form').calx({
        onupdate : function(data){
            //do something with the data
        }
    });

Awesome! Thank you.

Now I just need to figure out how to make the loop.

    $('#auto-loan-payment').calx({
        onupdate : function(data){
            var myCount = 0;
            var myArray=new Array();

            $.each(data, function( key, value ) {
                if(key.indexOf("bal") == 0)
                {
                    myCount++;
                    myArray.push(new Array(myCount,value));
                }
            // console.log( key + ": " + value );
            });

            $.plot("#placeholder", [{
                data: myArray,
                bars: { show: true,
                        barWidth: .75
                    }
            }]);

        }
    });