plotly / plotly/plotly.js

[BUG] [REGRESSION]: `tickprefix`/`ticksuffix` ignored when `tickvals` provided

Open
#8,006 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug P3 size: 1
Dominant language
JavaScript
Stars
18.3k
Forks
2k
Avg merge
2d 12h
Merged PRs (30d)
28

Description

Codepen: https://codepen.io/emilykl-code/pen/jEBbzvL

In plotly.js v2.29.1 and earlier, tickprefix and ticksuffix would be applied as expected when tick values were provided with tickvals:

Image

However starting with v2.30.0 and continuing to the latest v4.0.0, suddenly tickprefix and ticksuffix are ignored when tickvals is passed:

Image

There's no reason why tickprefix/ticksuffix can't coexist with tickvals, so this should be fixed.

This bug was also noticed in plotly.py issues https://github.com/plotly/plotly.py/issues/4041, https://github.com/plotly/plotly.py/issues/4678

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the linked CodePen with plotly.js v2.29.1 and v2.30.0, using tickvals together with tickprefix and ticksuffix. Trace the axis tick-label formatting path and locate the relevant regression test area. Done means both prefixes and suffixes render with explicitly provided tick values, with coverage for the regression.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.