From 91d04c64771832a0b8815ffbe1f0f9920320d94d Mon Sep 17 00:00:00 2001 From: Pamela Dragosh Date: Tue, 14 Feb 2017 19:41:00 -0500 Subject: Initial OpenECOMP policy/engine commit Change-Id: I7dbff37733b661643dd4d1caefa3d7dccc361b6e Signed-off-by: Pamela Dragosh --- .../main/webapp/static/fusion/sample/js/charts.js | 132 +++++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/js/charts.js (limited to 'ecomp-sdk-app/src/main/webapp/static/fusion/sample/js/charts.js') diff --git a/ecomp-sdk-app/src/main/webapp/static/fusion/sample/js/charts.js b/ecomp-sdk-app/src/main/webapp/static/fusion/sample/js/charts.js new file mode 100644 index 000000000..4bebbd365 --- /dev/null +++ b/ecomp-sdk-app/src/main/webapp/static/fusion/sample/js/charts.js @@ -0,0 +1,132 @@ + +function drawSingleSeriesChart(tabId, chartId, chartWidth, chartHeight, chartType, chartData,mme,yyyyMo) { + // define, set the data for each chart, and render them (if indicated) + var myChart = new FusionCharts("static/fusion/inc/fusionchart/" + chartType, "myChartId" + chartId, chartWidth, chartHeight); + + var mmeLabel = "";//mme + ""; + + var chartCaptionId = tabId + "-chartdiv" + chartId + "-label"; + + document.getElementById(chartCaptionId).innerHTML = "Hosted Voice Usage in "+ yyyyMo; + + myChart.setDataXML("" + chartData + ""); + myChart.setTransparent(true); + myChart.render(tabId + "-"+ "chartdiv" + chartId); + + + } + + + // gauge charts + function drawGaugeChart(chartId, gaugeIndex, value) { + var myChart = new FusionCharts("static/fusion/inc/fusionchart/AngularGauge.swf", "myChartId" + chartId, "300", "300", "0", "0"); + //CPU for NYCMNYBWLT1 on 201301 : 12.63// + var chartData = + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + ""; + + myChart.setDataXML(chartData); + myChart.render("chartdiv" + chartId); + } + + + function updateGaugeChart(chartId, gaugeIndex, refreshCount) { + var myChart = getChartFromId("myChartId" + chartId); + var val = 0; + if (gaugeIndex == "10") val = 12; + else if (gaugeIndex == "20") val = 15; + else if (gaugeIndex == "30") val = 52; + else if (gaugeIndex == "40") val = 42; + myChart.setData(1, val); + myChart.setData(2, val+20); + } + + function updateGaugeChartWithMMEData(chartId, value) { + var myChart = getChartFromId("myChartId" + chartId); + myChart.setData(1, value); + } + + + function updateGaugeChartWithMMEData(chartId, value, yyyyMo, mme) { + var myChart = getChartFromId("myChartId" + chartId); + myChart.setData(1, value); + document.getElementById("cpuYyyyMm").innerHTML = "Hosted Voice Utilization in "+ yyyyMo; + + } + + function drawMultiSeriesChart(tabId,chartId, chartWidth, chartHeight, chartType) { + var myChart = new FusionCharts("static/fusion/inc/fusionchart/" + chartType, "myChartId" + chartId, chartWidth, chartHeight, "0", "0"); + + myChart.setTransparent(true); + + var chartData = + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + ""; + + myChart.setDataXML(chartData); + myChart.render(tabId + "-" + "chartdiv" + chartId); + } + -- cgit 1.2.3-korg