I suggest  that you use a labelFunction feeding a renderer that uses
htmlText.  The label function would simply parse the strings to get the
letters,  and wrap them in a Font tag specifying the color.  This would be
very easy.

 

Tracy Spratt,

Lariat Services, development services available

  _____  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of valdhor
Sent: Wednesday, April 22, 2009 4:44 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: RegEx string via cell ItemRenderer to colorize
specific characters or a better method?

 






Have a look into TextRange.

--- In flexcod...@yahoogro <mailto:flexcoders%40yahoogroups.com> ups.com,
Adrian Williams <adri...@...> wrote:
>
> Hi All,
> 
> Here's a fun one!
> 
> I have a column in an ADG, and the cells can contain a variety of 
> data including: 
> 
> 16223T,16290T,16319A,16362C,16524G
> or
> 73G,249-,263G,290-,291-,309.1C,315.1C,489C,493G,522-,523-
> 
> What I need to do is for each of the letters (there's four possible 
> - A,T,C,G) I need to be able to change the font color specific to each 
> letter...i.e. all the "A's" need to be green, the "C's" need to be blue, 
> the "G's" need to be black and the "T's" need to be red.
> 
> As I've been thinking about it, I figure I'm going to have to use a 
> custom itemRenderer for the cell to manipulate the data to begin with. 
> But within the renderer, I'm quasi-stuck. I figure the simplest way to 
> ID the letters is to RegExp the data...then possibly using a switch/case 
> to set the colors for the letters...but not sure how to affect just the 
> individual letters in the overall string and then return that with the 
> cell's renderer??
> 
> Anyone have any thoughts on this?
> 
> Thanks!
> Adrian
>



Reply via email to