Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow custom formatting of metrics #72

Closed
inconshreveable opened this issue Jun 19, 2014 · 4 comments · Fixed by #88
Closed

Allow custom formatting of metrics #72

inconshreveable opened this issue Jun 19, 2014 · 4 comments · Fixed by #88
Assignees

Comments

@inconshreveable
Copy link

You can't current modify a metric to add something like a '$' in front, or format the number to have commas, control the number of decimal places, etc. If you try to modify this.data.result before calling draw to turn the value into a string, you get the error message "The library you selected does not support this chartType"

It would be nice to basically give users the ability to specify their own "prettyPrint" function. So that they can output a custom formatted value.

@dustinlarimer
Copy link
Contributor

Great idea!

@wetzler
Copy link

wetzler commented Jun 26, 2014

Another user reported this in chat today.

"I was wondering if there is an equivalent for the 'prefix/suffix' option when drawing a Number in JavaScript SDK 3.0?"

ruleant added a commit to buildtimetrend/python-lib that referenced this issue Jun 26, 2014
Units are added to the title, until keen/keen-js#72 is fixed
@dustinlarimer dustinlarimer self-assigned this Jun 27, 2014
@inconshreveable
Copy link
Author

any thoughts on reopening this to support a generic format() function that lets you do arbitrary transforms so that we don't need special cases for each one? (prefixes, suffixes, # of decimal places, scientific notation, commas like 1,000,000, etc)

@dustinlarimer
Copy link
Contributor

Yup! That exists in dataform today, just needs a sensible input from the keen-js viz setup.

On Tue, Jul 22, 2014 at 5:48 PM, inconshreveable notifications@github.com
wrote:

any thoughts on reopening this to support a generic format() function that lets you do arbitrary transforms so that we don't need special cases for each one? (prefixes, suffixes, # of decimal places, scientific notation, commas like 1,000,000, etc)

Reply to this email directly or view it on GitHub:
#72 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants