From 98d55b2ff2b7aba74ba7840de042873da88408d1 Mon Sep 17 00:00:00 2001 From: Rsl1122 Date: Thu, 1 Feb 2018 18:17:53 +0200 Subject: [PATCH] Added World Name to GameMode slices (#491) --- .../main/resources/web/js/charts/worldPie.js | 19 +++++++++++++++---- .../plan/litebans/LiteBansData.java | 2 +- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Plan/src/main/resources/web/js/charts/worldPie.js b/Plan/src/main/resources/web/js/charts/worldPie.js index 3d72cc926..ccca32c8f 100644 --- a/Plan/src/main/resources/web/js/charts/worldPie.js +++ b/Plan/src/main/resources/web/js/charts/worldPie.js @@ -1,14 +1,25 @@ function worldPie(id, worldSeries, gmSeries) { - Highcharts.chart(id, { + var defaultTitle = ''; + var defaultSubtitle = 'Click the slices to view used GameMode'; + + var chart = Highcharts.chart(id, { chart: { plotBackgroundColor: null, plotBorderWidth: null, plotShadow: false, - type: 'pie' + type: 'pie', + events: { + drilldown: function (e) { + chart.setTitle({text: '' + e.point.name}, {text: ''}); + }, + drillup: function (e) { + chart.setTitle({text: defaultTitle}, {text: defaultSubtitle}); + } + } }, - title: {text: ''}, + title: {text: defaultTitle}, subtitle: { - text: 'Click the slices to view used GameMode' + text: defaultSubtitle }, plotOptions: { pie: { diff --git a/PlanPluginBridge/src/main/java/com/djrapitops/pluginbridge/plan/litebans/LiteBansData.java b/PlanPluginBridge/src/main/java/com/djrapitops/pluginbridge/plan/litebans/LiteBansData.java index 1b844a95e..23713012e 100644 --- a/PlanPluginBridge/src/main/java/com/djrapitops/pluginbridge/plan/litebans/LiteBansData.java +++ b/PlanPluginBridge/src/main/java/com/djrapitops/pluginbridge/plan/litebans/LiteBansData.java @@ -53,7 +53,7 @@ public class LiteBansData extends PluginData implements BanData { List warns = db.getWarnings(uuid); List kicks = db.getKicks(uuid); if (bans.isEmpty() && mutes.isEmpty() && warns.isEmpty() && kicks.isEmpty()) { - table.addRow("Not Banned/Muted/Warned/Kicked"); + table.addRow("None"); } else { for (LiteBansDBObj ban : bans) { long expiry = ban.getExpiry();