generalize the d3.js mixed chart function to handle multiple types of curves i.e hazard curves and spectral curves