This is an example of Vue 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.
U.S. GDP Percentage Change(source: Bureau of Economic Analysis)2008-Q12008-Q22008-Q32008-Q42009-Q12009-Q22009-Q32009-Q42010-Q12010-Q22010-Q32010-Q42011-Q12011-Q22011-Q32011-Q42012-Q12012-Q22012-Q32012-Q42013-Q12013-Q22013-Q32013-Q4Percentage Change-10%-8%-6%-4%-2%0%2%4%6%