Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

_bullet measure and range bars have issues if the data set has negative values #4497

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

Open
ksheehy wants to merge 3 commits into plotly:main
base: main
Choose a base branch
Loading
from ksheehy:ff_bullet_negative_scale

Conversation

Copy link

@ksheehy ksheehy commented Jan 26, 2024
edited by ndrezn
Loading

The issue is with the method of sorting the data from highest to lowest. The data needs to be sorted so both, the largest positive and negative values are plotted first.

# Vertical Velocity
data = (
 {"label": "Vertical Velocity", "sublabel": "[FPM]",
 "range": sorted([-5000, -3000, 3000, 5000]), "performance": [-2000, -1000, 1000, 2000], "point": [500], 'command': [600]},
)
fig = ff.create_bullet(
 data, titles='label', subtitles='sublabel', markers='point',
 measures='performance', ranges='range', orientation='v',
 title='Bullet Chart',
 scatter_options={'marker': {'symbol': 'diamond'}},
 width=300,
)
fig.show()

Here is the current implementation - you can see since the sort function puts the -5000 tick mark last and the bar on top of all less negative values.
Screenshot 2024年01月26日 130212

Here is a fix.
Screenshot 2024年01月26日 130307

I did a little search on this function and it looks like it is being depreciated. I appologize if I have butchered the PR process.

@ksheehy ksheehy changed the title (削除) _bullet has an issue building measure and range bars if the data set ... (削除ここまで) (追記) _bullet measure and range bars have bugs if the data set has negative values (追記ここまで) Jan 26, 2024
@ksheehy ksheehy changed the title (削除) _bullet measure and range bars have bugs if the data set has negative values (削除ここまで) (追記) _bullet measure and range bars have issues if the data set has negative values (追記ここまで) Jan 26, 2024
@Coding-with-Adam Coding-with-Adam added bug something broken sev-4 cosmetic labels Feb 1, 2024
Copy link
Contributor

Thank you for reporting this, @ksheehy

ksheehy reacted with thumbs up emoji

Copy link
Contributor

Hi @archmoj
Here's the code pen for this issue:
https://codepen.io/charming-data/pen/ExJwxRY

archmoj reacted with thumbs up emoji

Copy link
Contributor

archmoj commented Mar 28, 2024

Thanks very much for the PR.
This looks good.
Please add a test in packages/python/plotly/plotly/tests/test_optional/test_figure_factory/test_figure_factory.py to lock this bug.

@gvwilson gvwilson added P3 backlog fix fixes something broken community community contribution and removed sev-4 cosmetic bug something broken labels Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@marthacryan marthacryan Awaiting requested review from marthacryan

1 more reviewer

@archmoj archmoj archmoj left review comments

Reviewers whose approvals may not affect merge requirements

At least 1 approving review is required to merge this pull request.

Labels
community community contribution fix fixes something broken P3 backlog
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /