question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Percentage formatter for yaxis

See original GitHub issue

I’m plotting rates over time, and I have an abstraction that scales all of my values input into plotly by 100, and sets the axes accordingly

Would be nice to contribute it back to Plotly, just not sure where it would go or if this is something you’d like in the core functionality

I saw in #79 that exponentformat seems to be the place to do formatting for the axes.

Curious on your idea for on hover, as ideally these would show formatted when you add they parameter to hoverinfo (e.g. it would be 52% instead of 0.52). This is currently achieved through scaling the values and manually adding them through the annotations.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
alexander-alvarezcommented, Jan 28, 2016

oh interesting. ticksuffix affects the hoverinfo suffix too – as does tickformat – that’s the ideal behavior. I would have never thought to look under the tick... name for something related to the way the data is represented in hoverinfo. But I guess it kind of makes sense since it’s attached to the axis itself.

1reaction
etpinardcommented, Jan 28, 2016

In the example attached I’d like to label each of the yAxis labels with a % after the number, similarly in the ‘y’ value of the tooltip.

You can already do so using yaxis.ticksuffix, example: http://codepen.io/etpinard/pen/pgVVqr

Read more comments on GitHub >

github_iconTop Results From Across the Web

Format y axis as percent - Stack Overflow
PercentFormatter () accepts three arguments, xmax , decimals , symbol . xmax allows you to set the value that corresponds to 100% on...
Read more >
matplotlib: How to easily format y value as percent [%]
This post shows how to easily plot this dataset with an y axis formatted as percent. We will assume that 1.00 maps to...
Read more >
Convert Y-axis Labels to a Percentage in Python Matplotlib
The matplotlib.ticker library provides an easy way to convert the y-axis number formatting in Matplotlib. Here's how to turn a decimal y-axis ...
Read more >
Formatting Y-axis percentage range. - Tableau Community
I wanted to change the percentages of Y-Axis(Not the number to percentage)since the axis now displays 20000% instead of 20%.
Read more >
yAxis.labels.formatter | highcharts API Reference
Since v7.1.2: If it's a percentage string, it is interpreted the same as series.radius, so label can be aligned under the gauge's shape....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found