This is an example of JavaScript chart line series with conditional colors. The data of the chart is loaded from a csv file. The colorFunction is modified to return the desired color. jqxChart will call this function for each data point. Sequential points that have the same color will be grouped automatically in a line segment.