You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By examining the axis._getFormat method it seems that axis.tickFormat must be a string that will get passed to d3.format. Is there a reason why this couldn't also be any function that takes the value and returns a string? This would make the formatting even more flexible.
This can be accomplished by monkeypatching that seems to work without problems in my simple usage. Eg:
functionmy_custom_format(value){// Any transformation to string herereturn"prefix"+parseInt(value*100)+"postfix";}varax=chart.addMeasureAxis('x','value');ax._getFormat=function(){returnmy_custom_format;};
However, such ugliness would be unnecessary if axis._getFormat would check if the axis.tickFormat is a function and returning it if so.
If preferred, I can make a pull request of such a feature, but the line or two is probably faster added by an existing commiter if this proposal is accepted.
The text was updated successfully, but these errors were encountered:
By examining the
axis._getFormat
method it seems thataxis.tickFormat
must be a string that will get passed tod3.format
. Is there a reason why this couldn't also be any function that takes the value and returns a string? This would make the formatting even more flexible.This can be accomplished by monkeypatching that seems to work without problems in my simple usage. Eg:
However, such ugliness would be unnecessary if
axis._getFormat
would check if theaxis.tickFormat
is a function and returning it if so.If preferred, I can make a pull request of such a feature, but the line or two is probably faster added by an existing commiter if this proposal is accepted.
The text was updated successfully, but these errors were encountered: