Chart.js: [FEATURE] Horizontal bar chart in combination with a line chart

Created on 20 Mar 2017  路  6Comments  路  Source: chartjs/Chart.js

When I create an horizontal bar chart and set one of the datasets to 'line' it doesn't show. I suspect the axis for the line chart is not changed with the parent horizontalBar chart.
I think the expected behaviour is to let the main chart type be leading, in this case the horizontal bar chart, so that the datasets that are provided don't need to be changed.

This example would work with a normal bar-chart, but not with an horizontal bar-chart:
chartData : { labels: [ 'apple', 'orange', 'banana', 'coconut' ], datasets: [ { title: 'Taste', data: [ 1,4,2,3 ] }, { title: 'Throwability', data: [ 5,4,2,3 ], type: 'line' } }

help wanted enhancement

Most helpful comment

Any updates on this one? I am needing to do this as well. I'm building a gantt type chart and using horizontalBar type to do that. I was hoping I could overlay a line series or scatter plot to display milestone markers.

All 6 comments

@kresten8 I think something happens with the axes being reversed and so the line tries to plot the data points vs the Y axis instead of the X axis

Any updates on this one? I am needing to do this as well. I'm building a gantt type chart and using horizontalBar type to do that. I was hoping I could overlay a line series or scatter plot to display milestone markers.

Apparently, this is not possible with chartjs as of now for anyone else looking for this. Horizontal bar charts can't be used with any other charts.

Guys this would be very useful, according to this it looks like it's possible but I have not been able to reproduce on my end. If anyone knows a workaround, I would love to plot dots.

Any update on this please. -.- I saw a lot of questions asking for this but it's still Open since 2017.

This feature would be much appreciated :)

Was this page helpful?
0 / 5 - 0 ratings