Right now, Chart XY widget doesn't support this advanced functionality but you can configure dynamically colored lines using the new Vega chart widget.
https://www.palantir.com/docs/foundry/workshop/widgets-vega-chart