Skip to content

Commit

Permalink
Added optional parameter 'id' to JSON for BarChart
Browse files Browse the repository at this point in the history
Added optional parameter 'id' to Jit BarChart, because the previous implementation was not allowing two or more same labels.
If an id is not specified, it is using key => value, where key is the label, and for two same labels it would not count the second one.
If an id is specified, it will use id => value.
bor0 committed May 22, 2013
1 parent b371fea commit 966e357
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Source/Visualizations/BarChart.js
Original file line number Diff line number Diff line change
@@ -536,8 +536,11 @@ $jit.BarChart = new Class({
var val = values[i]
var valArray = $.splat(values[i].values);
var acum = 0;
if (typeof val.id == 'undefined') {
val.id = val.label;
}
ch.push({
'id': prefix + val.label,
'id': prefix + val.id,
'name': val.label,
'data': {
'value': valArray,

0 comments on commit 966e357

Please sign in to comment.