Skip to content

Commit

Permalink
show compare graphs
Browse files Browse the repository at this point in the history
  • Loading branch information
salicio committed Apr 18, 2010
1 parent 6333f1b commit 0ee04c5
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions public/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,18 @@ function single_graph() {
};

function compare_graph() {
var divs = ["holder_a","holder_b"];
var ingrs = [ingresos,ingresos2];
var gasts = [gastos,gastos2];
var divs = ingrs = gasts = [];

if ($('#holder_a').length != 0) {
divs = ["holder_a"];
ingrs = [ingresos];
gasts = [gastos];
}
if ($('#holder_b').length != 0) {
divs = (divs.length > 0) ? ["holder_a","holder_b"] : ["holder_b"];
ingrs = (ingrs.length > 0) ? [ingresos, ingresos2] : [ingresos2];
gasts = (gasts.length > 0) ? [gastos, gastos2] : [gastos2];
}

for (var x=0; x < divs.length; x++) {
var paper = Raphael(divs[x], 460, 530);
Expand Down

0 comments on commit 0ee04c5

Please sign in to comment.