From 638697ad6b7ca61aac5543d94a7b8d1f7ec2cba3 Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Thu, 7 Aug 2014 14:24:38 -0400 Subject: [PATCH] fixed empty Host Count pie chart circle and centered text --- awx/ui/static/js/widgets/HostPieChart.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/awx/ui/static/js/widgets/HostPieChart.js b/awx/ui/static/js/widgets/HostPieChart.js index da5d615dfb..6932ce92af 100644 --- a/awx/ui/static/js/widgets/HostPieChart.js +++ b/awx/ui/static/js/widgets/HostPieChart.js @@ -49,7 +49,9 @@ angular.module('HostPieChartWidget', ['RestServices', 'Utilities']) var winHeight = $(window).height(), available_height = winHeight - $('#main-menu-container .navbar').outerHeight() - $('#count-container').outerHeight() - 120; $('.graph-container').height(available_height/2); - host_pie_chart.update(); + if(host_pie_chart){ + host_pie_chart.update(); + } } }); @@ -104,16 +106,16 @@ angular.module('HostPieChartWidget', ['RestServices', 'Utilities']) winHeight = $(window).height(); available_height = winHeight - $('#main-menu-container .navbar').outerHeight() - $('#count-container').outerHeight() - 120; $('.graph-container:eq(1)').height(available_height/2); - $('.host-pie-chart svg').replaceWith(''); + $('.host-pie-chart svg').replaceWith(''); canvas = document.getElementById("circlecanvas"); context = canvas.getContext("2d"); - context.arc(50, 50, 50, 0, Math.PI * 2, false); + context.arc(55, 55, 50, 0, Math.PI * 2, false); context.lineWidth = 1; context.strokeStyle = '#1778c3'; context.stroke(); context.font = "12px Open Sans"; - context.fillText("No Host data",10,50); + context.fillText("No Host data",18,55); scope.$emit('WidgetLoaded'); }