The green and red background colors of the rows used in the previous post are a bit aggressive for the reader. We want to convey the same information (sales amount was better/worse than last year) but in a less aggressive way. We decided to show red/green traffic lights in an additional column.
First, we need to create the traffic lights pictures as PNG files. Then, we introduce in the KNIME workflow a “Rule Engine” node after the “Math Formula” node. The “Rule Engine” node implements the traffic light logic; that is it creates a new column called “image”, containing the path to the red (green) traffic light file if “ratio” is less than or equal to (greater than) 0.
With KNIME 2.3 is now possible to read PNG files by using the “Read PNG Images” node. After the “Rule Engine” node we place a “Read PNG Images” node, to translate the paths to the PNG images to real PNG images in the column called “image”. The “Read PNG Images” node is then connected to “Data To Report” node.
Without going through the “Highlight” setup, just run a “Preview” to see the new table with a red/green traffic light in each row.