Skip to content

Commit

Permalink
Closed-Bug:#1581650
Browse files Browse the repository at this point in the history
1)Replaced the database reads stack bar chart with analytics database usage in analytics summary page
2)Fixed the issue last bar is hidden in all summary page stack charts.

Closes-Bug:#1581650
Using the single node color as default color, when there is not data to plot in monitor infra config and analytics stack bar charts.

Closes-Bug:1611355
Added safety check in LogListModel.

Change-Id: I23a4b239d0191252401f51abf3883296795b5cc0
  • Loading branch information
vishnuvv committed Aug 10, 2016
1 parent d77b99e commit ab9e6ff
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions webroot/js/common/core.constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -999,6 +999,7 @@ define([
var args = arguments;
return cowu.getValueFromTemplate(args);
};
this.DEFAULT_COLOR = '#adcfdc';
};
//Export to global scope
cowc = new CoreConstants();
Expand Down
2 changes: 1 addition & 1 deletion webroot/js/models/LogListModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ define(['contrail-list-model'], function(ContrailListModel) {

function parseDashboardLogs(result) {
var UVEModuleIds = monitorInfraConstants.UVEModuleIds;
retArr = $.map(result['data'],function(obj,idx) {
retArr = $.map(getValueByJsonPath(result,'data',[]),function(obj,idx) {
obj['message'] = cowu.formatXML2JSON(obj['Xmlmessage']);
obj['timeStr'] = diffDates(new XDate(obj['MessageTS']/1000),new XDate());
if(obj['Source'] == null)
Expand Down
10 changes: 7 additions & 3 deletions webroot/js/views/StackedBarChartWithFocusView.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ define([
var showLegend = getValueByJsonPath(viewConfig,'chartOptions;showLegend',false);
var legendFn = getValueByJsonPath(viewConfig,'chartOptions;legendFn',null);
var colorMap = getValueByJsonPath(viewConfig,'chartOptions;colorMap',{});
var yAxisFormatter = getValueByJsonPath(viewConfig,'chartOptions;yAxisFormatter',cowu.numberFormatter);
var sliceTooltipFn = null;

//sliceTooltipFn is for portion of bar in stacked bar.
Expand Down Expand Up @@ -156,7 +157,7 @@ define([
.scale(y)
.orient("left")
.ticks(3)
.tickFormat(cowu.numberFormatter)
.tickFormat(yAxisFormatter)
.innerTickSize(-width)
.outerTickSize(0)
.tickPadding(tickPadding);
Expand Down Expand Up @@ -221,7 +222,7 @@ define([
if (obj.total == 0) {
ifNull(obj['counts'], []).push({
tooltip: false,
color: obj.colorCodes[0],
color: getValueByJsonPath(obj, 'colorCodes;0', cowc.DEFAULT_COLOR),
y0: 0,
y1: yAxisMaxValue * 0.01
})
Expand Down Expand Up @@ -254,7 +255,10 @@ define([
x.domain(dateExtent);
if (barWidth == null && bucketSize != null) {
bucketSize = bucketSize * 60 * 1000;
barWidth = d3.scale.ordinal().domain(d3.range(dateExtent[0].getTime(), dateExtent[1].getTime(), bucketSize)).rangeRoundBands(x.range(),0.08).rangeBand();
var maxValue = dateExtent[1].getTime() + bucketSize;
//need to remove constant 12 (barwidth) and make it dynamic
x.range([0, width - 12]);
barWidth = d3.scale.ordinal().domain(d3.range(dateExtent[0].getTime(), dateExtent[1].getTime(), bucketSize)).rangeRoundBands(x.range(), 0.08).rangeBand();
}
y.domain(yExtent);
xOverview.domain(x.domain());
Expand Down

0 comments on commit ab9e6ff

Please sign in to comment.