aboutsummaryrefslogtreecommitdiffstats
path: root/uiframe-iui/src/main/resources/webroot/vendor/ict/dashboard-jq/demo/demo-linechart-c3.js
diff options
context:
space:
mode:
Diffstat (limited to 'uiframe-iui/src/main/resources/webroot/vendor/ict/dashboard-jq/demo/demo-linechart-c3.js')
-rw-r--r--uiframe-iui/src/main/resources/webroot/vendor/ict/dashboard-jq/demo/demo-linechart-c3.js41
1 files changed, 41 insertions, 0 deletions
diff --git a/uiframe-iui/src/main/resources/webroot/vendor/ict/dashboard-jq/demo/demo-linechart-c3.js b/uiframe-iui/src/main/resources/webroot/vendor/ict/dashboard-jq/demo/demo-linechart-c3.js
new file mode 100644
index 00000000..2991a8b6
--- /dev/null
+++ b/uiframe-iui/src/main/resources/webroot/vendor/ict/dashboard-jq/demo/demo-linechart-c3.js
@@ -0,0 +1,41 @@
+var seriesCount = 3;
+var xMaxLength = 60;
+var colors = ["#d12610", "#37b7f3", "#52e136"];
+
+var ICT_CPU_UsageLine_C3 = function (placeholderC3) {
+
+ var c3Line = ICT_Line_C3(placeholderC3);
+
+ var data = {};
+ var maxNumber = 60;
+
+ function randomNumber() {
+ return Math.floor((Math.random() * maxNumber) + 1);
+ }
+
+ if (!$.facebox.isExpand(placeholderC3)) {
+ $.facebox.intervals[placeholderC3] = window.setInterval(function () {
+
+ //var newSeriesData = {};
+ var newSeriesData = [];
+
+ $.ajax({
+ dataType: "json",
+ "type": "GET",
+ url: "/web/rest/web/dm/dashboard/selfcpu/queryValues",
+ "data": JSON.stringify(data),
+ contentType: "application/json; charset=utf-8",
+ "success": function (data) {
+ //newSeriesData.data1 = data.cpuUseRatios[0];
+ //newSeriesData.data2 = randomNumber();
+ newSeriesData.push({name: "data1", value: data.cpuUseRatios[0]});
+ newSeriesData.push({name: "data2", value: randomNumber()});
+ newSeriesData.push({name: "data3", value: randomNumber()});
+ c3Line.setC3Data(newSeriesData);
+ }
+ });
+
+ }, 3 * 1000);
+ }
+
+} \ No newline at end of file