From accf6518e9fd59d69eefc99973b3023ff208ba35 Mon Sep 17 00:00:00 2001 From: Mark Brough Date: Sat, 23 Feb 2013 16:18:01 +0000 Subject: [PATCH] Show field labels rather than id on legend --- src/view.flot.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/view.flot.js b/src/view.flot.js index 20d9c374..5506c4f3 100644 --- a/src/view.flot.js +++ b/src/view.flot.js @@ -313,6 +313,7 @@ my.Flot = Backbone.View.extend({ var series = []; _.each(this.state.attributes.series, function(field) { var points = []; + var fieldLabel = self.model.fields.get(field).get('label'); _.each(self.model.records.models, function(doc, index) { var xfield = self.model.fields.get(self.state.attributes.group); var x = doc.getFieldValue(xfield); @@ -341,7 +342,7 @@ my.Flot = Backbone.View.extend({ }); series.push({ data: points, - label: field, + label: fieldLabel, hoverable: true }); });