Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions jqBarGraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
max = max(data);
colPosition = 0; // for printing colors on simple bar graph

for(var val in data){
$.each(data, function(val, valData){

valueData = data[val][0];
if (valueData instanceof Array)
Expand Down Expand Up @@ -180,13 +180,13 @@
sv = arr.prefix+valueData[i]+arr.postfix;
fs = 12; // font-size is 0 if showValues = false
}
o = "<div class='subBars"+el.id+"' style='height:"+heig+"px; background-color: "+arr.colors[i]+"; left:"+wid*i+"px; color:"+arr.showValuesColor+"; font-size:"+fs+"px' >"+sv+"</div>";
o = "<div class='subBars"+el.id+"' style='width:"+wid+"px;height:"+heig+"px; background-color: "+arr.colors[i]+"; left:"+wid*i+"px; color:"+arr.showValuesColor+"; font-size:"+fs+"px' >"+sv+"</div>";
$('#graphFieldBar'+unique).prepend(o);
}
}

if(arr.type=='multi')
$('.subBars'+el.id).css({ 'width': wid, 'position': 'absolute', 'bottom': 0 });
$('.subBars'+el.id).css({ 'position': 'absolute', 'bottom': 0 });

//position of bars
if(arr.position == 'bottom') $('.graphField'+el.id).css('bottom',0);
Expand All @@ -203,12 +203,12 @@
$('#graphFieldBar'+unique).css({'height': fieldHeight});
}

}
});

//creating legend array from legends param
for(var l in arr.legends){
$.each(arr.legends, function(l, lData){
leg.push([ arr.colors[l], arr.legends[l], el.id, l ]);
}
});

createLegend(leg); // create legend from array

Expand Down Expand Up @@ -285,4 +285,4 @@
return 0;
}

})(jQuery);
})(jQuery);