<% else %>
<% timeline = 'timeline' + widget.id.to_s %>
- <div id="timeline-chart-<%= widget.id -%>" style="height: <%= chartHeight -%>px;"></div>
+ <div id="timeline-chart-<%= widget.id -%>"></div>
<script>
function d(y, m, d, h, min, s) {
return new Date(y, m, d, h, min, s);
.snapshots(snapshots)
.metrics(metrics)
.events(events);
+ <%= timeline -%>.limitedHistoricalData = '<%= message('widget.timeline.limited_histortical_data') -%>';
<%= timeline -%>.render();
autoResize(200, function() {
.ticks(5);
+ this.showLimitHistoryMessage();
+
+
// Configure lines and points
this.lines = [];
this.glines = [];
};
+ window.SonarWidgets.Timeline.prototype.showLimitHistoryMessage = function () {
+ var minEvent = d3.min(this.events(), function (d) {
+ return d.d;
+ }),
+ minData = this.time.domain()[0];
+ if (minEvent < minData) {
+ var maxResultsReachedLabel = this.container.append('div').text(this.limitedHistoricalData);
+ maxResultsReachedLabel.classed('max-results-reached-message', true);
+ }
+ };
+
window.SonarWidgets.Timeline.prototype.update = function() {
var widget = this,
}
}
-.sonar-d3 .max-results-reached-message {
+.max-results-reached-message {
font-size: 12px;
}
-.sonar-d3 div.max-results-reached-message {
+div.max-results-reached-message {
margin-top: 10px;
color: #777;
text-align: center;
}
-.sonar-d3 text.max-results-reached-message {
+text.max-results-reached-message {
fill: #777;
}
widget.timeline.property.metric3.name=Metric 3
widget.timeline.property.hideEvents.name=Hide events
widget.timeline.property.chartHeight.name=Chart Height
+widget.timeline.limited_histortical_data=Current timeline is reduced to a shorter period because of limited historical data for one of the metric.
widget.bubble_chart.name=Project File Bubble Chart
widget.bubble_chart.description=Display a component's source files in a Bubble chart. Both axes and bubble size are configurable.