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

Horizontal Bars mix with lines #4096

Closed
joaofiliperocha opened this issue Mar 31, 2017 · 14 comments · Fixed by #7514
Closed

Horizontal Bars mix with lines #4096

joaofiliperocha opened this issue Mar 31, 2017 · 14 comments · Fixed by #7514

Comments

@joaofiliperocha
Copy link

Expected Behavior

Horizontal Bars mix with line

Current Behavior

I have vertical bar with mix line chart, when it changes the type to horizontal bar the other dataset desapear

@etimberg
Copy link
Member

@joaofiliperocha do you have a test case that reproduces this issue?

@lwlwlwlw
Copy link

lwlwlwlw commented Apr 1, 2017

I also want to draw a horizontal bar chart mixed with a line chart, using data like this:

week, bar, line
Monday, 1, 10
Tuesday, 2, 20
Wednesday, 3, 30
Thursday, 4, 40
Friday, 5, 50
Saturday, 6, 60
Sunday, 7, 70

could you please help with a sample code? Thanks.

@rafaelCMoura
Copy link

rafaelCMoura commented Apr 5, 2017

@joaofiliperocha. I think that you can't plot a line chart mixed with a horizontalBar, because we don't have an "horizontalLine" chart type. @lwlwlwlw Try this sample. @etimberg

@fdefelici
Copy link

+1

@joaofiliperocha
Copy link
Author

I found this .. hope it helps

https://plnkr.co/edit/ubR7Luf4NisgxqR2sVUr?p=preview

@rafaelCMoura
Copy link

rafaelCMoura commented Apr 26, 2017

@johnpitchko
Copy link

Here is a codepen that demonstrates the issue, if that is useful:

https://codepen.io/johnpitchko/pen/OjzGrr

@EpicKip
Copy link

EpicKip commented Dec 15, 2017

@etimberg So is this ever going to be supported? The website advertises Mixed charts... that gives the impression you can mix more then a handful of predefined mixes

@weberhofer
Copy link

It would be a great thing to have vertical lines, too

@jetfontanilla
Copy link

mixed chart still doesn't support horizontalBar + line yet?

@weberhofer
Copy link

weberhofer commented Aug 9, 2018

No, verticalLines would be required, but there are none.

@nagix
Copy link
Contributor

nagix commented Nov 1, 2018

If you use {x: 1, y: 'label'} format for lines, they will be drawn. Try to replace the following part in https://codepen.io/johnpitchko/pen/OjzGrr.

data: {
  datasets: [{
    label: "Clients Signed",
    data: [2, 0, 3, 5, 1, 3, 6, 5, 3, 10]
  }, {
    label: 'Quota',
    data: [{x: 2, y: 'Q2 2015'}, {x: 2, y: 'Q3 2015'}, {x: 2, y: 'Q4 2015'}, {x: 2, y: 'Q1 2016'}, {x: 2, y: 'Q2 2016'}, {x: 2, y: 'Q3 2016'}, {x: 2, y: 'Q4 2016'}, {x: 2, y: 'Q1 2017'}, {x: 2, y: 'Q2 2017'}, {x: 2, y: 'Q3 2017'}],
    type: 'line'
  }],
  labels: ['Q2 2015', 'Q3 2015', 'Q4 2015', 'Q1 2016', 'Q2 2016', 'Q3 2016', 'Q4 2016', 'Q1 2017', 'Q2 2017', 'Q3 2017']
}

screenshot 2018-11-01 at 3 17 38 pm

@wuahi
Copy link

wuahi commented Dec 7, 2018

What's the status of this, seems that the work-a-round (https://codepen.io/johnpitchko/pen/OjzGrr.) is not working anymore?

@EpicKip
Copy link

EpicKip commented Dec 7, 2018

@wuahi That one was never working, look at the post above you. You still have to replace it :) The trick for lines is this part:

data: [{x: 2, y: 'Q2 2015'}, {x: 2, y: 'Q3 2015'}, {x: 2, y: 'Q4 2015'}, {x: 2, y: 'Q1 2016'}, {x: 2, y: 'Q2 2016'}, {x: 2, y: 'Q3 2016'}, {x: 2, y: 'Q4 2016'}, {x: 2, y: 'Q1 2017'}, {x: 2, y: 'Q2 2017'}, {x: 2, y: 'Q3 2017'}],

instead of just giving a value, you're giving an object with x as the value and y the label

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

Successfully merging a pull request may close this issue.