From 1ba289eeea72f02d2063a40474f6aa5d7dfa42fa Mon Sep 17 00:00:00 2001 From: Alexandr Dubovikov Date: Thu, 15 Sep 2016 13:48:36 +0200 Subject: [PATCH] changed to more friendly output --- js/widgets/geochart/geochart.html | 6 ++++++ js/widgets/geochart/geochart.js | 31 +++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/js/widgets/geochart/geochart.html b/js/widgets/geochart/geochart.html index 66db0741..6638d371 100644 --- a/js/widgets/geochart/geochart.html +++ b/js/widgets/geochart/geochart.html @@ -2,6 +2,12 @@
Please select a query from the widget configuration
+ +
+ We don't have any chart data. Please enable GEO STATS in the config + of your capture server. +
+
diff --git a/js/widgets/geochart/geochart.js b/js/widgets/geochart/geochart.js index ffe5ddfa..610adef5 100644 --- a/js/widgets/geochart/geochart.js +++ b/js/widgets/geochart/geochart.js @@ -124,6 +124,21 @@ angular.module("homer.widgets.geochart", [ "adf.provider", "googlechart"]) $scope.$parent.changeReloading(false); console.log("RELOADING MAP",sdata); + if(sdata.length == 0) + { + var obj = {}; + obj.id = 1; + obj.cnt = 0; + obj.total = 0; + obj.country = "UN"; + obj.lat = 0; + obj.lon = 0; + obj.method = "NO"; + sdata[0] = obj; + $scope.noChartData = true; + } + else $scope.noChartData = false; + drawMap(sdata); }, function(sdata) { @@ -244,6 +259,22 @@ angular.module("homer.widgets.geochart", [ "adf.provider", "googlechart"]) if (config.chart && config.chart.hasOwnProperty("library") && config.chart.library.value == "google") { var seriesData = sipdata; + console.log("RELOADING MAP2",seriesData); + if(seriesData.length == 0) + { + var obj = {}; + obj.id = 1; + obj.cnt = 0; + obj.total = 0; + obj.country = "UN"; + obj.lat = 0; + obj.lon = 0; + obj.method = "NO"; + seriesData[0] = obj; + $scope.noChartData = true; + } + else $scope.noChartData = false; + drawMap(seriesData); }