Skip to content

Axis tickformat overrides exponentformat settings #1651

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

Closed
suribabu39 opened this issue May 8, 2017 · 5 comments
Closed

Axis tickformat overrides exponentformat settings #1651

suribabu39 opened this issue May 8, 2017 · 5 comments
Labels
bug something broken

Comments

@suribabu39
Copy link

suribabu39 commented May 8, 2017

Hi,
I am getting 'G' as suffix for y axis ticks if I use tickFormat, if I don't use tickFormat then it would show it with suffix 'B'. As y axis ticks are numbers I would like to show them with 'B' (with Million, Billion, Trillion formatting).
Codepen link1
Is there a way to show that way? Should I change tickFormat?
I have also tried using exponentformat, but still I am not getting ticks in Billions format.
Codepen link2
Thanks in advance,

@etpinard
Copy link
Contributor

etpinard commented May 8, 2017

maybe related to #1264

@alexander-alvarez
Copy link

I just got bit by this too.

It's related to https://github.com/plotly/plotly.js/blob/master/src/plots/cartesian/axes.js#L1375

@etpinard what's the desired behavior? If so we should fixup or document.

D3 does not provide a numeric type (a) like numeral.js does.
https://github.com/d3/d3-format/blob/master/README.md#locale_format
so while semi related to #1264 I'm not sure you can fix it with just the locale.

Removing my tickformat all together, and then adding tickprefix: '$' worked in my case, but not ideal since I'd have to manually manage tickprefix so it's aligned with the locale

@alexander-alvarez
Copy link

as an aside, I'm not seeing where the format functions use locales. Am I missing something?

@etpinard etpinard changed the title Showing ticks in 'G'-Format when tickFormat is used Axis tickformat overrides exponentformat settings Jul 17, 2017
@etpinard etpinard added the bug something broken label Jul 17, 2017
@etpinard
Copy link
Contributor

as an aside, I'm not seeing where the format functions use locales. Am I missing something?

That's correct, we don't use d3 locales anywhere in our code yet. You're correct, #1264 is a different problem, where layout.separators settings are overrode by tickformat.

@alexander-alvarez Thanks for digging around axes.js. Sounds like we'll need to partially reformat the output of d3.format instead of simply returning it.

@gvwilson
Copy link
Contributor

Hi - this issue has been sitting for a while, so as part of our effort to tidy up our public repositories I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our stack. Cheers - @gvwilson

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

No branches or pull requests

4 participants