In reply to MaggieK.

Yes, it works, but the NOTE reminds you that you might want to adjust the VLINE values to represent cumulative values. In the code you sent, the bar shows the cumulative totals, but the lines show the individual NCOST values.
If that's what you want, fine. But it might be clearer to show the cumulative NCOST values instead.