diff --git a/Plan/src/main/java/com/djrapitops/plan/utilities/html/graphs/WorldPieCreator.java b/Plan/src/main/java/com/djrapitops/plan/utilities/html/graphs/WorldPieCreator.java index 624fa9251..64167cb87 100644 --- a/Plan/src/main/java/com/djrapitops/plan/utilities/html/graphs/WorldPieCreator.java +++ b/Plan/src/main/java/com/djrapitops/plan/utilities/html/graphs/WorldPieCreator.java @@ -1,6 +1,7 @@ package main.java.com.djrapitops.plan.utilities.html.graphs; import main.java.com.djrapitops.plan.Plan; +import main.java.com.djrapitops.plan.Settings; import main.java.com.djrapitops.plan.WorldAliasSettings; import main.java.com.djrapitops.plan.data.time.GMTimes; import main.java.com.djrapitops.plan.data.time.WorldTimes; @@ -21,6 +22,9 @@ public class WorldPieCreator { * @return String array, index 0: Series data, 1: drilldown data */ public static String[] createSeriesData(WorldTimes worldTimes) { + String[] colors = Settings.THEME_GRAPH_WORLD_PIE.toString().split(", "); + int colLenght = colors.length; + StringBuilder seriesBuilder = new StringBuilder("["); int i = 0; // WorldTimes Map (GMTimes.getTotal) @@ -34,8 +38,14 @@ public class WorldPieCreator { int size = playtimePerAlias.size(); for (String alias : worlds) { + Long value = playtimePerAlias.getOrDefault(alias, 0L); + if (value == 0L) { + i++; + continue; + } seriesBuilder.append("{name:'").append(alias) - .append("',y:").append(playtimePerAlias.getOrDefault(alias, 0L)) + .append("',y:").append(value) + .append(",color:").append(colors[i % colLenght]) .append(",drilldown: '").append(alias).append("'"); seriesBuilder.append("}"); diff --git a/Plan/src/main/java/com/djrapitops/plan/utilities/html/structure/ServerAccordionCreator.java b/Plan/src/main/java/com/djrapitops/plan/utilities/html/structure/ServerAccordionCreator.java index 19a110129..9ae7b7838 100644 --- a/Plan/src/main/java/com/djrapitops/plan/utilities/html/structure/ServerAccordionCreator.java +++ b/Plan/src/main/java/com/djrapitops/plan/utilities/html/structure/ServerAccordionCreator.java @@ -98,7 +98,7 @@ public class ServerAccordionCreator { .append("
") // World Pie data script .append("") .append("") // Right col-6 diff --git a/Plan/src/main/java/com/djrapitops/plan/utilities/html/structure/SessionTabStructureCreator.java b/Plan/src/main/java/com/djrapitops/plan/utilities/html/structure/SessionTabStructureCreator.java index c27874eb0..7a5e06f88 100644 --- a/Plan/src/main/java/com/djrapitops/plan/utilities/html/structure/SessionTabStructureCreator.java +++ b/Plan/src/main/java/com/djrapitops/plan/utilities/html/structure/SessionTabStructureCreator.java @@ -118,7 +118,7 @@ public class SessionTabStructureCreator { .append("
") // World Pie data script .append("") .append("") // Right col-6 diff --git a/Plan/src/main/resources/web/player.html b/Plan/src/main/resources/web/player.html index f45e65272..056f7866f 100644 --- a/Plan/src/main/resources/web/player.html +++ b/Plan/src/main/resources/web/player.html @@ -602,7 +602,7 @@ var worldSeries = { name: 'World Playtime', colorByPoint: true, - colors: worldPieColors, +// colors: worldPieColors, data: ${worldPieSeries} }; var gmSeries = ${gmSeries}; diff --git a/Plan/src/main/resources/web/server.html b/Plan/src/main/resources/web/server.html index c1962dd31..13ab2fef8 100644 --- a/Plan/src/main/resources/web/server.html +++ b/Plan/src/main/resources/web/server.html @@ -1046,7 +1046,7 @@ var worldSeries = { name: 'World Playtime', colorByPoint: true, - colors: worldPieColors, +// colors: worldPieColors, data: ${worldSeries} }; var gmSeries = ${gmSeries};