How to combine rowStyleClss and rowClasses in t:dataTable - css

I have three css style classes. Each of them set the background colour of a JSF datatable row. One would make the colour of the row orange (rowHighlight), the second would colour the row white (rowWhite) and the third would colour the row grey (rowGrey).
When a certain condition is met, I want the table row to be orange. If the condition is not met, I want the colour of the rows to alternate between white and grey using the other two style sheets. The end result should have rows coloured in orange, white and grey.
I read that rowStyleClass can achieve changing the colour of a row based on a certain condition. I read that rowClasses can achieve making rows alternate colours.
I tried:
rowStyleClass="#{holidayInfo.country == ‘France’ ? 'rowHighlight' : '’ }"
rowClasses="rowWhite,rowGrey"
But this resulted in all rows being white.
I also tried:
rowStyleClass="#{holidayInfo.country == ‘France’ ? 'rowHighlight' : 'rowWhite,rowGrey'}"
But this resulted in the row being coloured in orange when the condition was met whilst all other rows were white.
Does anyone know if it is possible to combine the two? I am new to JSF.

I have managed to resolve the issue.
It looks like if you want to use rowClasses and rowStyleClass in the same datatable, the order of the attributes must be rowClasses first and rowStyleClass second.
I put rowStyleClass first and I had set the styleClass to be '' if the condition was not met. If this happened, rowClasses was ignored after setting the style class to ''.
When I put rowClasses first, it was executed and the row colour alternated between white and grey . the atttibute rowStyleClass class was not ignored because the rows where the condition was met was coloured in orange.
Thank you to everyone who helped me work this out.

Related

Tableau: The barc chart doubles it height with null values when I add color

Screenshot of the bargraph
I want to remove the yellow part that came from nowhere.
It says the yellow are null values but idk where they came from
This is my workbook: https://public.tableau.com/app/profile/kamalesh.ponnivalavan/viz/helpme/Sheet1?publish=yes
Notice that all the yellow colour values are exactly the same as the totals in the bar graph values below the yellow values.
You can eliminate the yellow simply by right clicking in the yellow colour in the colour legend and excluding the null values.
But I suspect the underlying data is where the problem starts. But the colour value is clearly calculated in some way before the data is imported into Tableau. None of the colour values in the table have non-null incident IDs, so I suspect you have done some aggregation and the presence of null values is a side-effect of that calculation. You should probably fix this as it will be easier to analyse the result in tableau if you do.

Add gradient color scale on a kable column

I need to create a table in the kable whose cells in a specific column have different colors based on the cell value, such as Excel's conditional color scale, but I'm not sure how to do that. Specifically, I need to turn the extreme positive values into green, the extreme negative values into red, and the values close to 0 into white like the following impression taken from Excel.
Anyone here can enlighten me?

Color specification for one group only

I am working on a script for plotting volcano plots for a specific number of groups that the user specifies, i.e. if he wants to have five groups colored, the script modifies the data set accordingly with a new column called color. All the other observations that are there shouldn't be highlighted specifically, but be grey.
Is it possible to only specify the color of one group while letting ggplot2 choose all the colors for the other groups available?
I couldn't solve this using scale_color_manual, since it expects values for all groups!
This image demonstrates my problem, all other features except the groups, i.e. the "Features (all)" group should be grey instead of red, however I want ggplot to color all other groups automatically...
Specifying a custom color palette and sorting the color column solved my problem :)

Apple Watch Table Design?

Is there a way to do these color-side-bars:
(source: imageupload.co.uk)
Without inserting Images?
Add a WKInterfaceButton and set its background color
otherwise Add a WKInterfaceSeparator and set its color
Add a group with two subgroups. The second subgroup contains the labels:
The second subgroup needs alignment vertical:
Change the radius of all groups to 0:
Change the size properties of the first subgroup (to realize the coloured line):
Change the colour of the first subgroup:
The result should look like this:

PHPExcel: how to get cell's fill color, that is set using conditional formatting?

I have a cell that has conditional formatting applied and a static color (green). The cell is red, if you view it in Excel (because of conditional formatting). If I use getStartColor(), I get the static color: green. If I use getEndColor() I get white. I'd like to get the red one.
How can I do that?
$conditionalStyles = $objPHPExcel->getActiveSheet()
->getStyle('B2')
->getConditionalStyles();
will return the conditional styles for the specified cell as an array:
You can loop through those, using getConditionType(), getOperatorType() and getConditions() (which can return an array of conditions) , etc to identify the conditional rule, test if the cell value matches that rule, and then use getStyle() to retrieve the style details

Resources