Adding a static line with real data to a DC.js
bar chart proved to be very difficult. Here's some example code to draw a line on top of a bar chart. Make sure to use the on('renderlet')
function to access the raw d3
chart, and the chart's internal scales (accessed through chart.x()
and chart.y()
). You'll get some weird positioning issues if you try to create your own d3.scale.linear()
scales for the line axes.
scottsfarley93 / dc_static_line_example Goto Github PK
View Code? Open in Web Editor NEWAn example for adding a static line to a dc.js bar chart.
Home Page: https://bl.ocks.org/scottsfarley93/894f5c32f1dca3c736b2fea72e58b974