@WidgetProperties(
{
@WidgetProperty(key = "chartTitle", type = WidgetPropertyType.STRING),
- @WidgetProperty(key = "metric1", type = WidgetPropertyType.METRIC),
+ @WidgetProperty(key = "metric1", type = WidgetPropertyType.METRIC, defaultValue = "ncloc"),
@WidgetProperty(key = "metric2", type = WidgetPropertyType.METRIC),
@WidgetProperty(key = "metric3", type = WidgetPropertyType.METRIC),
@WidgetProperty(key = "displayEvents", type = WidgetPropertyType.BOOLEAN),
- @WidgetProperty(key = "widgetHeight", type = WidgetPropertyType.INTEGER)
+ @WidgetProperty(key = "chartHeight", type = WidgetPropertyType.INTEGER)
}
)
public class TimelineWidget extends AbstractRubyTemplate implements RubyRailsWidget {
@Override
protected String getTemplatePath() {
- //return "/org/sonar/plugins/core/widgets/timeline.html.erb";
- return "/Users/fbellingard/Documents/Sonar/repos/sonar/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/timeline.html.erb";
+ return "/org/sonar/plugins/core/widgets/timeline.html.erb";
+ //return "/Users/fbellingard/Documents/Sonar/repos/sonar/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/timeline.html.erb";
}
}
\ No newline at end of file
js_translations += "}"
# Check if the widget height was specified
- widgetHeight = widget_properties["widgetHeight"].to_i == 0 ? "null" : widget_properties["widgetHeight"]
+ chartHeight = widget_properties["chartHeight"].to_i == 0 ? "null" : widget_properties["chartHeight"]
%>
<% if widget_properties["chartTitle"] %>
var translations = <%= js_translations -%>;
var events = <%= js_events ? js_events : "null" -%>;
var timeline = new SonarWidgets.Timeline('timeline-chart-<%= widget.id -%>')
- .height(<%= widgetHeight -%>)
+ .height(<%= chartHeight -%>)
.data(data)
.snapshots(snapshots)
.metrics(metrics)