Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

formatting yaxis with XgXsXc

  • Loading branch information...
commit a52df7852a5036a00f1aa1b941809e476307eb32 1 parent f97b8e0
@rubensayshi authored
Showing with 24 additions and 1 deletion.
  1. +24 −1 templates/chart_placeholder.html.twig
View
25 templates/chart_placeholder.html.twig
@@ -33,7 +33,30 @@ $.ajax("{{ "/chart/" ~ item.dataId }}", {
yaxis: {
zoomRange: false,
panRange: false,
- minTickSize: 1
+ minTickSize: 1,
+ tickFormatter: function(copper) {
+ var string = "";
+
+ var gold = Math.floor(copper / 10000);
+ if (gold) {
+ copper = copper % (gold * 10000);
+ string += gold + "g ";
+ }
+
+ var silver = Math.floor(copper / 100);
+ if (silver) {
+ copper = copper % (silver * 100);
+ if (silver) string += silver + "s ";
+ }
+
+ if (copper) string += copper + "c ";
+
+ if (!string) {
+ return copper + "c";
+ } else {
+ return string;
+ }
+ }
},
zoom: {
interactive: true
Please sign in to comment.
Something went wrong with that request. Please try again.