Skip to content

Pie show incorrect value (in scientific format) when hovered over #5122

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
chiehrosswang opened this issue Sep 3, 2020 · 2 comments · Fixed by #5152
Closed

Pie show incorrect value (in scientific format) when hovered over #5122

chiehrosswang opened this issue Sep 3, 2020 · 2 comments · Fixed by #5152
Assignees
Labels
bug something broken

Comments

@chiehrosswang
Copy link

chiehrosswang commented Sep 3, 2020

I am working with some large numbers in pie charts. I came across some incorrect values in scientific format. The value of L1 should be 3.31E+10 but it's showing 3.31E+1. Same error is seen in L2.

image

Below is a snip of the code and here is a working example: http://jsfiddle.net/3u05bo89/12/.

var data = [{
  values: [33103474584, 58115093734, 123036969165],
  labels: ['L1', 'L2', 'L3'],
  type: 'pie',
  hoverinfo: 'label+value+percent'
}];

var data = [{
  values: [33103474584, 58115093734, 123036969165],
  labels: ['L1', 'L2', 'L3'],
  type: 'pie',
  hoverinfo: 'label+value+percent'
}];

var layout = {
  height: 400,
  width: 400,
	title:"Test Piechart"
};

Plotly.newPlot('myDiv1', data, layout);
@alexcjohnson
Copy link
Collaborator

Nice catch @chiehrosswang! Looks to me as though we're stripping trailing zeros - on the assumption that they're coming after a decimal point, but in this case the zero is in the exponent instead 🤦

@alexcjohnson alexcjohnson added the bug something broken label Sep 3, 2020
@chiehrosswang
Copy link
Author

Thanks @alexcjohnson that makes sense 😄

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.

3 participants