updated charting function, adding option to use custom color range on chart