Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

bug fix #2176

Merged
merged 3 commits into from
Oct 20, 2016
Merged

bug fix #2176

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,28 @@
link: function postLink(scope, element, attrs) {

// define variables
var sId, oChart;
var sId = "", oChart;

// define variables of methods
var setIdAutomatically, setWidthHeight, render, showCursorAt, resize;

/**
* set id automatically
*/
setIdAutomatically = function () {
function setIdAutomatically() {
sId = 'multipleValueAxesId-' + scope.namespace;
element.attr('id', sId);
};
}

function hasId() {
return sId === "" ? false : true;
}

/**
* set width height
* @param w
* @param h
*/
setWidthHeight = function (w, h) {
function setWidthHeight(w, h) {
if (w) element.css('width', w);
if (h) element.css('height', h);
};
}

function renderUpdate(data) {
oChart.dataProvider = data;
oChart.validateData();
}

/**
* render
* @param chartData
*/
render = function (chartData) {
function render(chartData) {
var options = {
"type": "serial",
"theme": "light",
Expand Down Expand Up @@ -131,13 +125,9 @@
scope.$emit( "activeTraceChartDirective.cursorChanged." + scope.namespace, event);
});
});
};
}

/**
* show cursor at
* @param category
*/
showCursorAt = function (category) {
function showCursorAt(category) {
if (category) {
if (angular.isNumber(category)) {
category = oChart.dataProvider[category].time;
Expand All @@ -146,22 +136,23 @@
} else {
oChart.chartCursor.hideCursor();
}
};
}

/**
* resize
*/
resize = function () {
function resize() {
if (oChart) {
oChart.validateNow();
oChart.validateSize();
}
};
}

scope.$on( "activeTraceChartDirective.initAndRenderWithData." + scope.namespace, function (event, data, w, h) {
setIdAutomatically();
setWidthHeight(w, h);
render( data );
if ( hasId() ) {
renderUpdate( data );
} else {
setIdAutomatically();
setWidthHeight(w, h);
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 @@ -75,10 +75,8 @@
}
oProgressBarService.setLoading(80);
showCharts(result);
$timeout(function () {
oProgressBarService.setLoading(100);
oProgressBarService.stopLoading();
}, 700);
oProgressBarService.setLoading(100);
oProgressBarService.stopLoading();
callback();
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,34 +19,28 @@
link: function postLink(scope, element, attrs) {

// define variables
var sId, oChart;
var sId = "", oChart;

// define variables of methods
var setIdAutomatically, setWidthHeight, render, showCursorAt, resize;

/**
* set id automatically
*/
setIdAutomatically = function () {
function setIdAutomatically() {
sId = 'multipleValueAxesId-' + scope.namespace;
element.attr('id', sId);
};
}

function hasId() {
return sId === "" ? false : true;
}

/**
* set width height
* @param w
* @param h
*/
setWidthHeight = function (w, h) {
function setWidthHeight(w, h) {
if (w) element.css('width', w);
if (h) element.css('height', h);
};
}

function renderUpdate(data) {
oChart.dataProvider = data;
oChart.validateData();
}

/**
* render
* @param chartData
*/
render = function (chartData) {
function render(chartData) {
var options = {
"type": "serial",
"theme": "light",
Expand Down Expand Up @@ -129,13 +123,9 @@
scope.$emit('cpuLoadChartDirective.cursorChanged.' + scope.namespace, event);
});
});
};
}

/**
* show cursor at
* @param category
*/
showCursorAt = function (category) {
function showCursorAt(category) {
if (category) {
if (angular.isNumber(category)) {
category = oChart.dataProvider[category].time;
Expand All @@ -144,37 +134,29 @@
} else {
oChart.chartCursor.hideCursor();
}
};
}

/**
* resize
*/
resize = function () {
function resize() {
if (oChart) {
oChart.validateNow();
oChart.validateSize();
}
};
}

/**
* scope event on cpuLoadChartDirective.initAndRenderWithData.namespace
*/
scope.$on('cpuLoadChartDirective.initAndRenderWithData.' + scope.namespace, function (event, data, w, h) {
setIdAutomatically();
setWidthHeight(w, h);
render(data);
if ( hasId() ) {
renderUpdate( data );
} else {
setIdAutomatically();
setWidthHeight(w, h);
render(data);
}
});

/**
* scope event on cpuLoadChartDirective.showCursorAt.namespace
*/
scope.$on('cpuLoadChartDirective.showCursorAt.' + scope.namespace, function (event, category) {
showCursorAt(category);
});

/**
* scope event on cpuLoadChartDirective.resize.namespace
*/
scope.$on('cpuLoadChartDirective.resize.' + scope.namespace, function (event) {
resize();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,36 +17,29 @@
namespace: '@' // string value
},
link: function postLink(scope, element, attrs) {
console.log( "------init" );

// define variables
var sId, oChart;
var sId = "", oChart;

// define variables of methods
var setIdAutomatically, setWidthHeight, render, showCursorAt, resize;

/**
* set id automatically
*/
setIdAutomatically = function () {
function setIdAutomatically() {
sId = 'multipleValueAxesId-' + scope.namespace;
element.attr('id', sId);
};
}
function hasId() {
return sId === "" ? false : true;
}

/**
* set width height
* @param w
* @param h
*/
setWidthHeight = function (w, h) {
function setWidthHeight(w, h) {
if (w) element.css('width', w);
if (h) element.css('height', h);
};
}

function renderUpdate(data) {
oChart.dataProvider = data;
oChart.validateData();
}

/**
* render
* @param chartData
*/
render = function (chartData) {
function render(chartData) {
var options = {
"type": "serial",
"theme": "light",
Expand Down Expand Up @@ -145,13 +138,9 @@
scope.$emit('jvmMemoryChartDirective.cursorChanged.' + scope.namespace, event);
});
});
};
}

/**
* show cursor at
* @param category
*/
showCursorAt = function (category) {
function showCursorAt(category) {
if (category) {
if (angular.isNumber(category)) {
category = oChart.dataProvider[category].time;
Expand All @@ -160,37 +149,26 @@
} else {
oChart.chartCursor.hideCursor();
}
};
}

/**
* resize
*/
resize = function () {
function resize() {
if (oChart) {
oChart.validateNow();
oChart.validateSize();
}
};

/**
* scope event on jvmMemoryChartDirective.initAndRenderWithData.namespace
*/
}
scope.$on('jvmMemoryChartDirective.initAndRenderWithData.' + scope.namespace, function (event, data, w, h) {
setIdAutomatically();
setWidthHeight(w, h);
render(data);
if ( hasId() ) {
renderUpdate( data );
} else {
setIdAutomatically();
setWidthHeight(w, h);
render(data);
}
});

/**
* scope event on jvmMemoryChartDirective.showCursorAt.namespace
*/
scope.$on('jvmMemoryChartDirective.showCursorAt.' + scope.namespace, function (event, category) {
showCursorAt(category);
});

/**
* scope event on jvmMemoryChartDirective.resize.namespace
*/
scope.$on('jvmMemoryChartDirective.resize.' + scope.namespace, function (event) {
resize();
});
Expand Down
Loading