[#151,view/graph,bugfix][xs]: parse string as numbers if we can when plotting them - fixes #151.

This commit is contained in:
Rufus Pollock 2012-06-08 21:00:29 +01:00
parent 20191bf9fa
commit 1e65468f33

View File

@ -260,7 +260,10 @@ my.Graph = Backbone.View.extend({
var yfield = self.model.fields.get(field);
var y = doc.getFieldValue(yfield);
if (typeof x === 'string') {
x = index;
x = parseFloat(x);
if (isNaN(x)) {
x = index;
}
}
// horizontal bar chart
if (self.state.attributes.graphType == 'bars') {