Skip to content

px.combo #2146

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
nicolaskruchten opened this issue Jan 30, 2020 · 1 comment
Closed

px.combo #2146

nicolaskruchten opened this issue Jan 30, 2020 · 1 comment
Milestone

Comments

@nicolaskruchten
Copy link
Contributor

Some common chart types that are very challenging to make with PX today include:

  • a chart with one bar and one line traces, on the same y-axis
  • a chart with two line traces, on opposite y-axes
  • variations on the above themes like bars and lines but on opposite y-axes

I propose a targeted PX function for these cases which I'm temporarily calling px.combo()

The way it would work is that it would accept two new grouped_attrs: yaxis and trace_type, along with the attendant yaxis_sequence and yaxis_map etc. yaxis would accept right and left, trace_type would accept line and bar.

If you had a data frame of time/money/temperature, you could melt() it so that variable would contain money/temperature and value would contain a mix of those values. You could then get a dual-axis bar/line chart with something like

px.combo(df_melted, x="time", y="value", 
    trace_type="variable", trace_type_map={"money":"line", "temperature":"bar"}, 
    yaxis="variable", yaxis_map={"money":"right", "temperature":"left"}
)
@nicolaskruchten nicolaskruchten added this to the v4.6.0 milestone Jan 30, 2020
@nicolaskruchten nicolaskruchten modified the milestones: v4.6.0, v4.x Mar 31, 2020
@nicolaskruchten
Copy link
Contributor Author

nicolaskruchten commented Nov 17, 2020

This would be an alternative to #2648

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant