There are many examples of extending a Chart to include a line, both horizontal and vertical. However, I have not found a way to draw a vertical line with a horizontal bar chart.
- Horizontal line on horizontal line chart
- Vertical line on horizontal line chart
- Horizontal line on vertical bar chart
There is not a "vertical line chart" option like there is a "horizontal bar chart" option. How do I combine a horizontal bar chart with a vertical line?
The result would have a bar dataset and a line dataset that can be used on the same chart using the same axis like below:
Have you tried this? It's a horizontal line with vertical bar charts - so the opposite of you case. But maybe you can derive something useful out of it:
http://jsfiddle.net/9nxcfzb9/12/
I'm looking for something similar to you but not with horizontal bar charts, but timespan bars, if you've got an idea, please let me know: How do I change or add the vertical line on a tooltip of a c3 graph?
ChartJS supports custom plugins. Create a plug in that will read a new property from the chart options and draw the line at the specified index.
See it on Plunkr