Conditional colur in Chart

According to AmCharts site here a bar in the chart can be coloured differently on condition. I need to colour a bar for the highest value in the chart and seems the abovementioned functionaly is a solution, how can we do this in CUBA?

This can be done:

taskPieChart.getDataProvider().addItem(taskCount("Violation",inWorkViolationCount));
if (inWorkViolationCount > CriticalCount) {
      taskPieChart.addColors(Color.RED);
} else {
      taskPieChart.addColors(Color.BLUE);
}