Skip to content

Instantly share code, notes, and snippets.

@Bastian
Last active May 13, 2021 17:44
Show Gist options
  • Save Bastian/4445ea82bc921dfef82de90b535deb3e to your computer and use it in GitHub Desktop.
Save Bastian/4445ea82bc921dfef82de90b535deb3e to your computer and use it in GitHub Desktop.
Multi Line Chart example
@Override
public void onEnable() {
Metrics metrics = new Metrics(this);
metrics.addCustomChart(new MultiLineChart("players_and_servers", new Callable<Map<String, Integer>>() {
@Override
public Map<String, Integer> call() throws Exception {
Map<String, Integer> valueMap = new HashMap<>();
valueMap.put("servers", 1);
valueMap.put("players", Bukkit.getOnlinePlayers().size());
return valueMap;
}
}));
}
// If you use the Copy & Paste Metrics classes, use `Metrics.MultiLineChart` instead
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment