Skip to content

Instantly share code, notes, and snippets.

@Bastian
Last active May 13, 2021 17:44
Show Gist options
  • Save Bastian/ea8804db0479c539153f53f1561cc7d3 to your computer and use it in GitHub Desktop.
Save Bastian/ea8804db0479c539153f53f1561cc7d3 to your computer and use it in GitHub Desktop.
Single Line Chart example
@Override
public void onEnable() {
Metrics metrics = new Metrics(this);
metrics.addCustomChart(new SingleLineChart("players", new Callable<Integer>() {
@Override
public Integer call() throws Exception {
// (This is useless as there is already a player chart by default.)
return Bukkit.getOnlinePlayers().size();
}
}));
}
// If you use the Copy & Paste Metrics classes, use `Metrics.SingleLineChart` instead
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment