Skip to content

Commit

Permalink
Merge pull request #2058 from denzelsN/master
Browse files Browse the repository at this point in the history
update title text of active trace chart
  • Loading branch information
denzelsN committed Sep 6, 2016
2 parents 034a185 + 6903861 commit b7273e1
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 34 deletions.
24 changes: 10 additions & 14 deletions web/src/main/webapp/common/services/agent-dao.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,35 +234,31 @@
var thisData = {
time: moment(aActiveTraceFastData[i].xVal).format( cfg.dateFormat )
};
var traceFace = typeof aActiveTraceFastData[i].avgYVal == "number" ? aActiveTraceFastData[i].avgYVal.toFixed(2) : 0.00;
var traceFast = typeof aActiveTraceFastData[i].avgYVal == "number" ? aActiveTraceFastData[i].avgYVal.toFixed(2) : 0.00;
var traceNormal = typeof aActiveTraceNormal[i].avgYVal == "number" ? aActiveTraceNormal[i].avgYVal.toFixed(2) : 0.00;
var traceSlow = typeof aActiveTraceSlow[i].avgYVal == "number" ? aActiveTraceSlow[i].avgYVal.toFixed(2) : 0.00;
var traceVerySlow = typeof aActiveTraceVerySlow[i].avgYVal == "number" ? aActiveTraceVerySlow[i].avgYVal.toFixed(2) : 0.00;
if ( traceFace != DATA_UNAVAILABLE ) {
thisData.traceFace = traceFace;
if ( traceFast != DATA_UNAVAILABLE ) {
thisData.fast = traceFast;
thisData.fastTitle = aActiveTraceFastData[i].title;
}
if ( traceNormal != DATA_UNAVAILABLE ) {
thisData.traceNormal = traceNormal;
thisData.normal = traceNormal;
thisData.normalTitle = aActiveTraceNormal[i].title;
}
if ( traceSlow != DATA_UNAVAILABLE ) {
thisData.traceSlow = traceSlow;
thisData.slow = traceSlow;
thisData.slowTitle = aActiveTraceSlow[i].title;
}
if ( traceVerySlow != DATA_UNAVAILABLE ) {
thisData.traceVerySlow = traceVerySlow;
thisData.verySlow = traceVerySlow;
thisData.verySlowTitle = aActiveTraceVerySlow[i].title;
}
newData.push(thisData);
}

return newData;
};
this.getActiveTraceChartCategoryTitleForAmcharts = function (agentStat) {
return {
"traceFace": agentStat.charts[ "ACTIVE_TRACE_FAST" ].title,
"traceNormal": agentStat.charts[ "ACTIVE_TRACE_NORMAL" ].title,
"traceSlow": agentStat.charts[ "ACTIVE_TRACE_SLOW" ].title,
"traceVerySlow": agentStat.charts[ "ACTIVE_TRACE_VERY_SLOW" ].title
};
};
}
]);
})();
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
* render
* @param chartData
*/
render = function (chartData, categoryTitle) {
render = function (chartData) {
console.log( chartData );
var options = {
"type": "serial",
"theme": "light",
Expand Down Expand Up @@ -69,39 +70,43 @@
],
"graphs": [
{
"balloonText": categoryTitle["traceFace"] + " : [[value]]",
"legendValueText": "[[value]]",
"balloonText": "[[description]] : [[value]]",
"legendValueText": "([[description]]) [[value]]",
"lineColor": "rgb(214, 141, 8)",
"fillColor": "rgb(214, 141, 8)",
"title": categoryTitle["traceFace"],
"valueField": "traceFace",
"title": "Fast",
"descriptionField": "fastTitle",
"valueField": "fast",
"fillAlphas": 0.4,
"connect": true
},{
"balloonText": categoryTitle["traceNormal"] + " : [[value]]",
"legendValueText": "[[value]]",
"balloonText": "[[description]] : [[value]]",
"legendValueText": "([[description]]) [[value]]",
"lineColor": "rgb(252, 178, 65)",
"fillColor": "rgb(252, 178, 65)",
"title": categoryTitle["traceNormal"],
"valueField": "traceNormal",
"title": "Normal",
"descriptionField": "normalTitle",
"valueField": "normal",
"fillAlphas": 0.4,
"connect": true
},{
"balloonText": categoryTitle["traceSlow"] + " : [[value]]",
"legendValueText": "[[value]]",
"balloonText": "[[description]] : [[value]]",
"legendValueText": "([[description]]) [[value]]",
"lineColor": "rgb(90, 103, 166)",
"fillColor": "rgb(90, 103, 166)",
"title": categoryTitle["traceSlow"],
"valueField": "traceSlow",
"title": "Slow",
"descriptionField": "slowTitle",
"valueField": "slow",
"fillAlphas": 0.4,
"connect": true
},{
"balloonText": categoryTitle["traceVerySlow"] + " : [[value]]",
"legendValueText": "[[value]]",
"balloonText": "[[description]] : [[value]]",
"legendValueText": "([[description]]) [[value]]",
"lineColor": "rgb(160, 153, 255)",
"fillColor": "rgb(160, 153, 255)",
"title": categoryTitle["traceVerySlow"],
"valueField": "traceVerySlow",
"title": "Very Slow",
"descriptionField": "verySlowTitle",
"valueField": "verySlow",
"fillAlphas": 0.4,
"connect": true
}
Expand Down Expand Up @@ -154,10 +159,10 @@
}
};

scope.$on( "activeTraceChartDirective.initAndRenderWithData." + scope.namespace, function (event, data, categoryTitle, w, h) {
scope.$on( "activeTraceChartDirective.initAndRenderWithData." + scope.namespace, function (event, data, w, h) {
setIdAutomatically();
setWidthHeight(w, h);
render(data, categoryTitle);
render( data );
});

scope.$on( "activeTraceChartDirective.showCursorAt." + scope.namespace, function (event, category) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@
scope.$broadcast( "jvmMemoryChartDirective.initAndRenderWithData.forNonHeap", AgentDaoService.parseMemoryChartDataForAmcharts(nonheap, agentStat), '100%', '270px');
scope.$broadcast( "cpuLoadChartDirective.initAndRenderWithData.forCpuLoad", AgentDaoService.parseCpuLoadChartDataForAmcharts(cpuLoad, agentStat), '100%', '270px');
scope.$broadcast( "tpsChartDirective.initAndRenderWithData.forTps", AgentDaoService.parseTpsChartDataForAmcharts(tps, agentStat), '100%', '270px');
scope.$broadcast( "activeTraceChartDirective.initAndRenderWithData.forActiveTrace", AgentDaoService.parseActiveTraceChartDataForAmcharts(activeTrace, agentStat), AgentDaoService.getActiveTraceChartCategoryTitleForAmcharts( agentStat ), '100%', '270px');
scope.$broadcast( "activeTraceChartDirective.initAndRenderWithData.forActiveTrace", AgentDaoService.parseActiveTraceChartDataForAmcharts(activeTrace, agentStat), '100%', '270px');
}
function getEventList( agentId, aFromTo ) {
AgentAjaxService.getEventList({
Expand Down

0 comments on commit b7273e1

Please sign in to comment.