diff --git a/front/src/css/rule.css b/front/src/css/rule.css index 9676b7d..9b51443 100644 --- a/front/src/css/rule.css +++ b/front/src/css/rule.css @@ -231,7 +231,7 @@ padding-top: 2.5em; } .totalWeightPie { - max-width: 39em; + max-width: 20em; margin: 2em auto 4em; } .totalWeightPie canvas { diff --git a/front/src/js/controllers/ruleCtrl.js b/front/src/js/controllers/ruleCtrl.js index f3da670..16c5c55 100644 --- a/front/src/js/controllers/ruleCtrl.js +++ b/front/src/js/controllers/ruleCtrl.js @@ -45,7 +45,23 @@ ruleCtrl.controller('RuleCtrl', ['$scope', '$rootScope', '$routeParams', '$locat }); $scope.weightOptions = { - tooltipTemplate: '<%=label%>: <%=value%> KB' + tooltips: { + callbacks: { + label: function(tooltipItem, data) { + var label = data.labels[tooltipItem.index]; + var value = data.datasets[tooltipItem.datasetIndex].data[tooltipItem.index]; + return label + ': ' + value + ' KB'; + } + } + }, + legend: { + display: true, + position: 'bottom', + labels: { + boxWidth: 12, + fontSize: 14 + } + } }; } @@ -87,14 +103,27 @@ ruleCtrl.controller('RuleCtrl', ['$scope', '$rootScope', '$routeParams', '$locat $scope.breakpointsSeries = ['Number of CSS rules per breakpoint']; $scope.breakpointsColours = ['#9c4274']; $scope.breakpointsOptions = { - scaleShowGridLines: false, - barShowStroke: false, - showTooltips: false, - pointDot: false, - responsive: true, - maintainAspectRatio: true, - strokeColor: 'rgba(20, 200, 20, 1)', - scaleFontSize: 9 + scales: { + xAxes: [{ + gridLines: { + display:false + } + }], + yAxes: [{ + gridLines: { + display:false + } + }] + }, + tooltips: { + enabled: false + }, + + elements: { + point: { + radius: 0 + } + } }; } } diff --git a/front/src/main.html b/front/src/main.html index f155eb1..c569b4e 100644 --- a/front/src/main.html +++ b/front/src/main.html @@ -16,7 +16,6 @@ - @@ -39,7 +38,7 @@ - + diff --git a/front/src/views/rule.html b/front/src/views/rule.html index 1291d43..f8d33d8 100644 --- a/front/src/views/rule.html +++ b/front/src/views/rule.html @@ -248,7 +248,7 @@

Weight by MIME type

- +

{{rule.offendersObj.list.byType[type].totalWeight | bytes}} of {{type}}

@@ -395,7 +395,7 @@

Breakpoints distribution graph

- +

Breakpoints list

diff --git a/package.json b/package.json index b947c1c..f5de624 100644 --- a/package.json +++ b/package.json @@ -22,14 +22,14 @@ "dependencies": { "angular": "1.5.7", "angular-animate": "1.5.7", - "angular-chart.js": "0.10.2", + "angular-chart.js": "1.1.1", "angular-local-storage": "0.2.7", "angular-resource": "1.5.7", "angular-route": "1.5.7", "angular-sanitize": "1.5.7", "async": "1.5.2", "body-parser": "1.15.2", - "chart.js": "1.1.1", + "chart.js": "2.4.0", "clean-css": "3.4.23", "color-diff": "1.0.0", "compression": "1.6.2",