Skip to content

Commit

Permalink
formatting yaxis with XgXsXc
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensayshi committed Aug 6, 2012
1 parent f97b8e0 commit a52df78
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion templates/chart_placeholder.html.twig
Expand Up @@ -33,7 +33,30 @@ $.ajax("{{ "/chart/" ~ item.dataId }}", {
yaxis: { yaxis: {
zoomRange: false, zoomRange: false,
panRange: 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: { zoom: {
interactive: true interactive: true
Expand Down

0 comments on commit a52df78

Please sign in to comment.