Skip to content

textposition: auto not used for log axis #3767

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
drkane opened this issue Apr 14, 2019 · 2 comments · Fixed by #3773
Closed

textposition: auto not used for log axis #3767

drkane opened this issue Apr 14, 2019 · 2 comments · Fixed by #3773
Assignees
Labels
bug something broken

Comments

@drkane
Copy link

drkane commented Apr 14, 2019

I've found an issue with textposition: auto when creating a horizontal bar chart.

When a linear axis is used, the text is correctly adjusted to fit into the available bar (see the first "monkeys" bar):
image

But for a log axis the text is not adjusted:
image

JSFiddle example

var data = [
  {
    y: ['giraffes', 'orangutans', 'monkeys'],
    text: ['giraffes', 'orangutans', 'monkeys'],
    x: [20, 14, 1],
    type: 'bar',
    orientation: 'h',
    textposition: 'auto',
  }
];

Plotly.newPlot('myDiv', data);
Plotly.newPlot('myDivLog', data, {
	xaxis: {
    type: 'log'
  }
});
@etpinard
Copy link
Contributor

Thanks for the report!

This issue appears similar to #3373

Looks like #3762 fixed the behavior (on master, not released yet) for vertical bars:

var data = [
  {
    x: ['giraffes', 'orangutans', 'monkeys'],
    text: ['giraffes', 'orangutans', 'monkeys'],
    y: [20, 14, 1],
    type: 'bar',
    textposition: 'auto',
  }
];

Plotly.newPlot('graph', data, {
	yaxis: { type: 'log' }
});

now renders as:

image

but something is still up for horizontal bars.

@etpinard etpinard added the bug something broken label Apr 15, 2019
@etpinard etpinard self-assigned this Apr 15, 2019
@drkane
Copy link
Author

drkane commented Apr 15, 2019

@etpinard - thanks for looking at this and fixing so quickly! 👍

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

Successfully merging a pull request may close this issue.

2 participants