Skip to content

Commit

Permalink
Merge pull request #212 from GordonSmith/GH-211
Browse files Browse the repository at this point in the history
GH-211 Use visualization title if it exists
  • Loading branch information
GordonSmith committed Feb 19, 2015
2 parents 27601ee + c71d0d3 commit f15e742
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion widgets/src/marshaller/Graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
}
newSurface = new ResizeSurface()
.size({ width: width, height: height })
.title(item.id)
.title(item.title)
.content(item.widget)
;
}
Expand Down
9 changes: 5 additions & 4 deletions widgets/src/marshaller/HipieDDL.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@
this.dashboard = dashboard;
this.id = visualization.id;
this.label = visualization.label;
this.title = visualization.title || visualization.id;
this.type = visualization.type;
this.properties = visualization.properties || visualization.source.properties || {};
this.source = new Source(this, visualization.source);
Expand All @@ -334,7 +335,7 @@
this.loadWidget("src/chart/MultiChartSurface", function (widget) {
widget
.chartType(context.properties.charttype || context.type)
.title(context.id)
.title(context.title)
;
});
break;
Expand All @@ -343,7 +344,7 @@
widget
.mode("multi")
.chartType(context.properties.charttype || context.type)
.title(context.id)
.title(context.title)
;
});
break;
Expand Down Expand Up @@ -461,10 +462,10 @@

var params = this.source.getOutput().getParams();
if (exists("widget.title", this)) {
this.widget.title(this.id +(params ? " (" +params + ")": ""));
this.widget.title(this.title + (params ? " (" +params + ")": ""));
this.widget.render();
} else if (exists("widgetSurface.title", this)) {
this.widgetSurface.title(this.id + (params ? " (" + params + ")" : ""));
this.widgetSurface.title(this.title + (params ? " (" + params + ")" : ""));
this.widgetSurface.render();
} else {
this.widget.render();
Expand Down

0 comments on commit f15e742

Please sign in to comment.