Skip to content
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

Bar stackgroup #3614

Closed
nicolaskruchten opened this issue Mar 7, 2019 · 10 comments
Closed

Bar stackgroup #3614

nicolaskruchten opened this issue Mar 7, 2019 · 10 comments
Labels
feature something new

Comments

@nicolaskruchten
Copy link
Contributor

We should finish the swing from #3402 and implement stackgroup for bar. Needed for px.

@etpinard etpinard added the feature something new label Mar 7, 2019
@etpinard
Copy link
Contributor

Related: #1835

@etpinard
Copy link
Contributor

etpinard commented May 2, 2019

@nicolaskruchten could you tell us a bit more about the current limitations of barmode: 'stack' for px?

I have a feeling making examples like:

image

(from #1835 (comment)) work as

Plotly.newPlot('graph', [{
  type: 'bar',
  x: ['Apples', 'Oranges', 'Pears', 'Grapes', 'Bananas'],
  y: [3, 4, 4, 2, 5],
  marker: {color: 'black'},
  offsetgroup: '1',
  stackgroup: '1'
}, {
  type: 'bar',
  x: ['Apples', 'Oranges', 'Pears', 'Grapes', 'Bananas'],
  y: [7, 3, 4, 7, 2],
  marker: {color: 'blue'},
  offsetgroup: '1',
  stackgroup: '1'
}, {  
  type: 'bar',
  x: ['Apples', 'Oranges', 'Pears', 'Grapes', 'Bananas'],
  y: [3, 0, 4, 4, 3],
  marker: {color: 'orange'},
  offsetgroup: '2',
  stackgroup: '2'
}, {
  type: 'bar',
  x: ['Apples', 'Oranges', 'Pears', 'Grapes', 'Bananas'],
  y: [2, 5, 6, 2, 1],
  marker: {color: 'green'},
  offsetgroup: '2',
  stackgroup: '2
}], {
  // !! no barmode !!
})

will require at least a full week of work - as it will require a subsequential refactoring of Bar.crossTraceCalc.

@etpinard
Copy link
Contributor

etpinard commented May 2, 2019

In addition, we'll probably need to add another trace attribute (named e.g. stackmode) to toggle between the barmode: 'stack' and barmode: 'relative' stacking behavior for a given stackgroup.

I'm imagining stackmode working in a similar way to stackgaps in scatter traces - where we use the "first" value found.

@nicolaskruchten
Copy link
Contributor Author

After some review, I can no longer think of the case(s) where this would be useful for px, and nothing has come up recently in that repo's feature requests, so if we can continue with bingroup without stackgroup then let's skip this one for 1.48.

Is this blocking #85, out of curiosity?

@etpinard
Copy link
Contributor

etpinard commented May 3, 2019

I can no longer think of the case(s) where this would be useful for px,

Ok, thanks for the info.

if we can continue with bingroup without stackgroup then let's skip this one for 1.48.

That's the solution I currently prefer. I'll try to get a PR up for bingroup w/o stackgroup early next week

Is this blocking #85, out of curiosity?

Not really, we could add an attribute (e.g. showstacktotal) that would get coerced only when barmode: 'stack'.

@georg90
Copy link

georg90 commented Jun 24, 2019

That's the solution I currently prefer. I'll try to get a PR up for bingroup w/o stackgroup early next week

So this is on hold? We could really need something like this in plotly:
image

@etpinard etpinard assigned etpinard and archmoj and unassigned etpinard Oct 28, 2019
@lisanne187
Copy link

lisanne187 commented Nov 26, 2019

Hi @etpinard
what is the status on this topic? I'm very curious if the option to make stacked+grouped chart is already possible.
Thanks.

@nicolaskruchten
Copy link
Contributor Author

We don't have an ETA yet for this issue but we're still planning on addressing it :)

@archmoj archmoj removed their assignment Jan 9, 2020
@phoenix-down
Copy link

Any updates on this? We would love a real grouped stack bar charts, like the one @etpinard mentioned above:

#3614 (comment)

But with mixed line charts as well, like so:

linebar_projection_bar

@nicolaskruchten
Copy link
Contributor Author

Closing in favour of sponsored feature: #4914

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

No branches or pull requests

6 participants