Charts: Fix column number

This commit is contained in:
Aysam Guerler
2014-03-06 20:24:08 -05:00
parent ba366370ef
commit ccf0a66087
4 changed files with 16 additions and 13 deletions
@@ -34,7 +34,11 @@ return Backbone.View.extend(
self.d3_chart = nv.models.multiBarChart();
self.d3_chart.xAxis.tickFormat(d3.format('.2f'))
self.d3_chart.yAxis.tickFormat(d3.format('.1f'))
.axisLabel('Breaks');
self.d3_chart.yAxis.tickFormat(d3.format('.3f'))
.axisLabel('Frequency')
.axisLabelDistance(30);
self.options.svg.datum(data)
.call(self.d3_chart);
@@ -115,7 +115,7 @@ return Backbone.Collection.extend(
// read value from row
var v = row[index];
if(isNaN(v)) {
if(isNaN(v) || !v) {
v = 0;
}
@@ -14,6 +14,14 @@ return Backbone.Model.extend(
}
}
},
'horizontal' : {
title : 'Bar diagram (horizontal)',
columns : {
y : {
title : 'Values for y-axis'
}
}
},
'histogram' : {
title : 'Histogram',
mode : 'execute',
@@ -23,14 +31,6 @@ return Backbone.Model.extend(
}
}
},
'horizontal' : {
title : 'Bar diagram (horizontal)',
columns : {
y : {
title : 'Values for y-axis'
}
}
},
'line' : {
title : 'Line chart',
columns : {
@@ -246,13 +246,12 @@ return Backbone.View.extend(
var group_index = 0;
chart.groups.each(function(group) {
for (var key in chart_settings.columns) {
request_string += key + '_' + (++group_index) + ':' + group.get(key) + ', ';
request_string += key + '_' + (++group_index) + ':' + (parseInt(group.get(key)) + 1) + ', ';
}
});
// return
return 'columns : 2';
//return request_string.substring(0, request_string.length - 2);
return request_string.substring(0, request_string.length - 2);
},
// create default chart request