I have an area graph (supposed to represent a time series). I want to color the graph based on the y value such that for regions where the y > c it is one color and for the are
Change the way you add the areas to something like
vis.selectAll("path").data(mpts).enter().append("svg:path") .attr("class", "area") .attr("d", area) .attr("fill", function(d) { return (d.val > c ? "orange" : "yellow"); });