Skip to content

Commit

Permalink
changed to more friendly output
Browse files Browse the repository at this point in the history
  • Loading branch information
adubovikov committed Sep 15, 2016
1 parent effd870 commit 1ba289e
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
6 changes: 6 additions & 0 deletions js/widgets/geochart/geochart.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
<div class="alert alert-info" ng-if="!mapConfig">
Please select a query from the widget configuration
</div>

<div class="alert alert-info" ng-if="noChartData">
We don't have any chart data. Please enable GEO STATS in the config
of your capture server.
</div>

<div ng-if="mapConfig" google-chart chart="chart">
</div>
</div>
Expand Down
31 changes: 31 additions & 0 deletions js/widgets/geochart/geochart.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);

}
Expand Down

0 comments on commit 1ba289e

Please sign in to comment.