Search code examples
ngx-charts

How to implement a high/low graph with ngx-charts


I want to make a high low graph with ngx-charts. It would graph a 0 as low and a 1 as high. In between low and high there is a line vertically connecting them (not diagonally like the standard implementation). Basically, [0,0,1,0] would be graphed as _ _ | ‾ | _ but the lines would be connected. I would post a picture, but I do not have enough reputation.

I've seen that there is the ability to inject d3 curve functions into the graph and I suspect that a custom function might produce the desired effect, but I am not familiar with d3 curve functions.


Solution

  • It turns out you can indeed use a d3 curve to accomplish this. The d3 curve I needed was 'stepAfter'.