Set pie slice color

Hey guys,
         I am creating pie chart based on xml data, which can have at most 6 categories, but not every time.  For consistency sake I would like pie slice to be colored by category, i.e every time I see category 1 it should be colored with c1, category 2 should be colored c2 etc.  By just setting fill property I don't always get the same color for category 2 if category 1 is missing. 
     Hope my objective is clear, does anyone have any idea, I have been nosing around adobe forms and google but no luck so far.
Thank you
Jay

Instead of a switch statement you could do this, the colors use the fieldname as id's so you then have a single line in your fillfunction.
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/halo" minWidth="1024" minHeight="768" xmlns:local="*">
<fx:Declarations>
<s:SolidColor id="Taxes" color="blue" alpha="1"/>
<s:SolidColor id="Rent" color="red" alpha="1"/>
<s:SolidColor id="Bills" color="green" alpha="1"/>
<s:SolidColor id="Car" color="gray" alpha="1"/>
<s:SolidColor id="Gas" color="black" alpha="1"/>
<s:SolidColor id="Food" color="yellow" alpha="1"/>
</fx:Declarations>
<fx:Script>
<![CDATA[
import mx.charts.series.items.PieSeriesItem;
import mx.graphics.IFill;
import mx.charts.ChartItem;
import mx.collections.ArrayCollection;
[Bindable]
public var expenses:ArrayCollection = new ArrayCollection([
{Expense:"Taxes", Amount:2000},
{Expense:"Rent", Amount:1000},
{Expense:"Bills", Amount:100},
{Expense:"Car", Amount:450},
{Expense:"Gas", Amount:100},
{Expense:"Food", Amount:200}
private function myFiller(item:ChartItem, index:Number):IFill
return(this[expenses[index].Expense]);
]]>
</fx:Script>
<mx:Panel title="Pie Chart">
<mx:PieChart id="myChart"
dataProvider="{expenses}"
showDataTips="true"
innerRadius=".3"
>
<mx:series>
<mx:PieSeries
field="Amount"
nameField="Expense"
    fillFunction="myFiller"
/>
</mx:series>
</mx:PieChart>
</mx:Panel>
</s:Application>

Similar Messages

  • PIE Chart Color Highlight - setting colors

    Hi
    PIE Chart showing default colors even after setting the diffent colors to OIE chart slices from Color Highlight tab.
    PIE chart is showing only one slice when I select Data for the PIE Char is "For all records".
    Could you please let me know how to set the different colors for slices?
    Thank you

    hi,
    As you are selecting 'Color Highlight' for different Pie Slices,  "For all records" option shouldn't be selected.
    It should be "On Change of".
    Then obviously you will see the colors specified in 'Color Hghlight' tab.
    Regards,
    Vamsee

  • Labels pointing to pie slices with lines (or how 2 set chart properties in code behind)

    I want to be able to create lines outside of my pie chart with labels and have those lines drawn to connect to the pie chart.  I saw that this can be done in code behind in the following thread:
    MSDN thread on lines to pie slices
    But my problem is I never declared an instance of my chart when I am using my code behind.  My code that makes the reports visible is basically (but not completely) the following:
    ReportDataSet.Tables.Add(ReportDataTable)
    ReportViewer.Visible = True
    Dim ReportDataSource As ReportDataSource = New ReportDataSource("ReportDataSource", ReportDataSet.Tables(0))
    ReportViewer.LocalReport.ReportPath = ReportToDisplay.RDLCFileName
    ReportViewer.LocalReport.DataSources.Clear()
    ReportViewer.LocalReport.DataSources.Add(ReportDataSource)
    ReportDataSource.Name = ReportToDisplay.DataSetName
    ReportViewer.DataBind()
    ReportViewer.LocalReport.Refresh()
    ReportViewer.ShowReportBody = True
    ReportViewer.Width = RVWidth
    ReportViewer.Height = RVHeight
    So how do I set chart properties for my report given the above code?  As long as I can set my chart properties with the above code, I should be able to get this to work given the above thread and the link to the Label-Outside-of-Pie and Line-Color properties
    (or whatever) info on Microsoft's info page

    Hello,
    Based on your description, you want to design a
    pie chart with outside lables and pie line inside a .rdlc report. If so, you can add the Chart report item into the report after open a client report definition (.rdlc) file in graphical design mode. And then Set the
    PieLabelStyle property and PieLineColor property. Please refer to the following screen shot:
    The link your post above it about the
    Chart Web server control. As pre my undersntand, you cannot reference a Web server control inside .rdlc file.
    If you have any question about using Chart Web server control, you can post a question on
    Chart Controls for .NET Framework forum.
    Regards,
    Fanny Liu
    If you have any feedback on our support, please click here. 
    Fanny Liu
    TechNet Community Support

  • Pie Chart Color Scheme

    Post Author: Janice
    CA Forum: Charts and Graphs
    I have a report written in Crystal Reports XI that has a pie chart in the Report Header displaying counts of activity by "reason code" for a selected time period.  The users have noticed that, when they run the report for different time periods, the same "reason" has a different color on each report.   It seems that the default is to sequence colors based on volume (size of 'pie wedge').
    They would like to have the colors appear linked to Reason Code rather than to volume.  Is there a way to change the pie chart color scheme so that it is coded by "description" not by "count"?

    hi,
    As you are selecting 'Color Highlight' for different Pie Slices,  "For all records" option shouldn't be selected.
    It should be "On Change of".
    Then obviously you will see the colors specified in 'Color Hghlight' tab.
    Regards,
    Vamsee

  • IGS Pie Graph - colors issue

    Hello all,
    I'm displaying an IGS Pie graph in a Web-Dynpro application.
    Since in a pie graph the different parts of the pie are of the same series in different elements,
    I couldn't find a way to set different colors to them using the chart designer.
    When choosing a specific color, all the parts appear in the same color.
    When choosing an automatic color, they appear in different color,
    but then I don't have control over the color.
    Is there a way to define the pie so that every part is of a different series?
    Otherwise, Is there a way (by using the chart designer or by code)
    To achieve an IGS pie graph with the colors of my choice?
    Thanks ahead for any help,
    Anuj

    Hi
    Use this [thread|IGS Pie Graph - colors issue; for IGS Pie Graph - colors issue problem.
    Best Regards
    Satish Kumar

  • Can't set up irssi colors

    I'm feeling really... stupid. I just can't set up irssi colors, almost ashame for asking advice on this
    Here's my theme (just cloned the default theme):
    # When testing changes, the easiest way to reload the theme is with /RELOAD.
    # This reloads the configuration file too, so if you did any changes remember
    # to /SAVE it first. Remember also that /SAVE overwrites the theme file with
    # old data so keep backups :)
    # TEMPLATES:
    # The real text formats that irssi uses are the ones you can find with
    # /FORMAT command. Back in the old days all the colors and texts were mixed
    # up in those formats, and it was really hard to change the colors since you
    # might have had to change them in tens of different places. So, then came
    # this templating system.
    # Now the /FORMATs don't have any colors in them, and they also have very
    # little other styling. Most of the stuff you need to change is in this
    # theme file. If you can't change something here, you can always go back
    # to change the /FORMATs directly, they're also saved in these .theme files.
    # So .. the templates. They're those {blahblah} parts you see all over the
    # /FORMATs and here. Their usage is simply {name parameter1 parameter2}.
    # When irssi sees this kind of text, it goes to find "name" from abstracts
    # block below and sets "parameter1" into $0 and "parameter2" into $1 (you
    # can have more parameters of course). Templates can have subtemplates.
    # Here's a small example:
    # /FORMAT format hello {colorify {underline world}}
    # abstracts = { colorify = "%G$0-%n"; underline = "%U$0-%U"; }
    # When irssi expands the templates in "format", the final string would be:
    # hello %G%Uworld%U%n
    # ie. underlined bright green "world" text.
    # and why "$0-", why not "$0"? $0 would only mean the first parameter,
    # $0- means all the parameters. With {underline hello world} you'd really
    # want to underline both of the words, not just the hello (and world would
    # actually be removed entirely).
    # COLORS:
    # You can find definitions for the color format codes in docs/formats.txt.
    # There's one difference here though. %n format. Normally it means the
    # default color of the terminal (white mostly), but here it means the
    # "reset color back to the one it was in higher template". For example
    # if there was /FORMAT test %g{foo}bar, and foo = "%Y$0%n", irssi would
    # print yellow "foo" (as set with %Y) but "bar" would be green, which was
    # set at the beginning before the {foo} template. If there wasn't the %g
    # at start, the normal behaviour of %n would occur. If you _really_ want
    # to use the terminal's default color, use %N.
    # default foreground color (%N) - -1 is the "default terminal color"
    default_color = "-1";
    # print timestamp/servertag at the end of line, not at beginning
    info_eol = "false";
    # these characters are automatically replaced with specified color
    # (dark grey by default)
    replaces = { "[]=" = "%K$*%n"; };
    abstracts = {
    ## generic
    # text to insert at the beginning of each non-message line
    line_start = "%B-%n!%B-%n ";
    # timestamp styling, nothing by default
    timestamp = "%K$*%n";
    # any kind of text that needs hilighting, default is to bold
    hilight = "%_$*%_";
    # any kind of error message, default is bright red
    error = "%R$*%n";
    # channel name is printed
    channel = "%_$*%_";
    # nick is printed
    nick = "%_$*%_";
    # nick host is printed
    nickhost = "[$*]";
    # server name is printed
    server = "%_$*%_";
    # some kind of comment is printed
    comment = "[$*]";
    # reason for something is printed (part, quit, kick, ..)
    reason = "{comment $*}";
    # mode change is printed ([+o nick])
    mode = "{comment $*}";
    ## channel specific messages
    # highlighted nick/host is printed (joins)
    channick_hilight = "%C$*%n";
    chanhost_hilight = "{nickhost %c$*%n}";
    # nick/host is printed (parts, quits, etc.)
    channick = "%c$*%n";
    chanhost = "{nickhost $*}";
    # highlighted channel name is printed
    channelhilight = "%c$*%n";
    # ban/ban exception/invite list mask is printed
    ban = "%c$*%n";
    ## messages
    # the basic styling of how to print message, $0 = nick mode, $1 = nick
    msgnick = "%K<%y$0%n$1-%K>%n %|";
    # message from you is printed. "msgownnick" specifies the styling of the
    # nick ($0 part in msgnick) and "ownmsgnick" specifies the styling of the
    # whole line.
    # Example1: You want the message text to be green:
    # ownmsgnick = "{msgnick $0 $1-}%g";
    # Example2.1: You want < and > chars to be yellow:
    # ownmsgnick = "%Y{msgnick $0 $1-%Y}%n";
    # (you'll also have to remove <> from replaces list above)
    # Example2.2: But you still want to keep <> grey for other messages:
    # pubmsgnick = "%K{msgnick $0 $1-%K}%n";
    # pubmsgmenick = "%K{msgnick $0 $1-%K}%n";
    # pubmsghinick = "%K{msgnick $1 $0$2-%n%K}%n";
    # ownprivmsgnick = "%K{msgnick $*%K}%n";
    # privmsgnick = "%K{msgnick %R$*%K}%n";
    # $0 = nick mode, $1 = nick
    ownmsgnick = "{msgnick $0 $1-}";
    ownnick = "%_$*%n";
    # public message in channel, $0 = nick mode, $1 = nick
    pubmsgnick = "{msgnick $0 $1-}";
    pubnick = "%N$*%n";
    # public message in channel meant for me, $0 = nick mode, $1 = nick
    pubmsgmenick = "{msgnick $0 $1-}";
    menick = "%Y$*%n";
    # public highlighted message in channel
    # $0 = highlight color, $1 = nick mode, $2 = nick
    pubmsghinick = "{msgnick $1 $0$2-%n}";
    # channel name is printed with message
    msgchannel = "%K:%c$*%n";
    # private message, $0 = nick, $1 = host
    privmsg = "[%R$0%K(%r$1-%K)%n] ";
    # private message from you, $0 = "msg", $1 = target nick
    ownprivmsg = "[%r$0%K(%R$1-%K)%n] ";
    # own private message in query
    ownprivmsgnick = "{msgnick $*}";
    ownprivnick = "%_$*%n";
    # private message in query
    privmsgnick = "{msgnick %R$*%n}";
    ## Actions (/ME stuff)
    # used internally by this theme
    action_core = "%_ * $*%n";
    # generic one that's used by most actions
    action = "{action_core $*} ";
    # own action, both private/public
    ownaction = "{action $*}";
    # own action with target, both private/public
    ownaction_target = "{action_core $0}%K:%c$1%n ";
    # private action sent by others
    pvtaction = "%_ (*) $*%n ";
    pvtaction_query = "{action $*}";
    # public action sent by others
    pubaction = "{action $*}";
    ## other IRC events
    # whois
    whois = "%# $[8]0 : $1-";
    # notices
    ownnotice = "[%r$0%K(%R$1-%K)]%n ";
    notice = "%K-%M$*%K-%n ";
    pubnotice_channel = "%K:%m$*";
    pvtnotice_host = "%K(%m$*%K)";
    servernotice = "%g!$*%n ";
    # CTCPs
    ownctcp = "[%r$0%K(%R$1-%K)] ";
    ctcp = "%g$*%n";
    # wallops
    wallop = "%_$*%n: ";
    wallop_nick = "%n$*";
    wallop_action = "%_ * $*%n ";
    # netsplits
    netsplit = "%R$*%n";
    netjoin = "%C$*%n";
    # /names list
    names_prefix = "";
    names_nick = "[%_$0%_$1-] ";
    names_nick_op = "{names_nick $*}";
    names_nick_halfop = "{names_nick $*}";
    names_nick_voice = "{names_nick $*}";
    names_users = "[%g$*%n]";
    names_channel = "%G$*%n";
    # DCC
    dcc = "%g$*%n";
    dccfile = "%_$*%_";
    # DCC chat, own msg/action
    dccownmsg = "[%r$0%K($1-%K)%n] ";
    dccownnick = "%R$*%n";
    dccownquerynick = "%_$*%n";
    dccownaction = "{action $*}";
    dccownaction_target = "{action_core $0}%K:%c$1%n ";
    # DCC chat, others
    dccmsg = "[%G$1-%K(%g$0%K)%n] ";
    dccquerynick = "%G$*%n";
    dccaction = "%_ (*dcc*) $*%n %|";
    ## statusbar
    # default background for all statusbars. You can also give
    # the default foreground color for statusbar items.
    sb_background = "%4%w";
    # default backround for "default" statusbar group
    #sb_default_bg = "%4";
    # background for prompt / input line
    sb_prompt_bg = "%n";
    # background for info statusbar
    sb_info_bg = "%8";
    # background for topicbar (same default)
    #sb_topic_bg = "%4";
    # text at the beginning of statusbars. sb-item already puts
    # space there,so we don't use anything by default.
    sbstart = "";
    # text at the end of statusbars. Use space so that it's never
    # used for anything.
    sbend = " ";
    topicsbstart = "{sbstart $*}";
    topicsbend = "{sbend $*}";
    prompt = "[$*] ";
    sb = " %c[%n$*%c]%n";
    sbmode = "(%c+%n$*)";
    sbaway = " (%GzZzZ%n)";
    sbservertag = ":$0 (change with ^X)";
    sbnickmode = "$0";
    # activity in statusbar
    # ',' separator
    sb_act_sep = "%c$*";
    # normal text
    sb_act_text = "%c$*";
    # public message
    sb_act_msg = "%W$*";
    # hilight
    sb_act_hilight = "%M$*";
    # hilight with specified color, $0 = color, $1 = text
    sb_act_hilight_color = "$0$1-%n";
    It's almost the way I want it, but a couple of things:
    - I want everyone nickname but mine in gray
    - I want the join/quit text (... has joined/quit) in gray
    - I want the mode (@, +, etc) in yellow
    I tried to format the text according irssi site, but without luck.
    For example tried this to change others nickname color:
    pubmsgnick = "{msgnick %y$0%n %K$1%n-}";
    pubnick = "%K$*%n";
    and this for the quit msg
    # mode change is printed ([+o nick])
    mode = "{comment %K$*%n}";
    # nick/host is printed (parts, quits, etc.)
    channick = "%c$*%n";
    chanhost = "{nickhost %c$*%n}";
    all without any luck. Also tried to put the format strings outside the curly braces, with the same result. I've been editing the config file for a while now, not sure what other information could you possibly need.
    I know it's not a big deal, I stil can use the program with no hassle, but it would really be nice to set the colors like that, to help me distinguish between lines.
    Thank you for reading, and sorry for my lousy english

    Nobody can tell you anything without proper system info or other technical details.
    Mylenium

  • How to set a background color to view

    Hi All,
              i creared a view with 2 textboxes and a button.These elements are in TransparentContainer.I set the background color to the TransparentContainer.By setting color to the TransparentContainer it is comming at the center and the 4 sides of it is displaying in the normal background color of the browser
    i didnt find any color options for the view called RootUIElementContainer.the width and height of the view are setted to the browser means 1024*768.
    Just like sap editor which we get by the link https://www.sdn.sap.com i want to get my view .....
    I want to set color to this RootUIElementContainer element which effect the whole view...not the containers or groups which i add under this RootUIElementContainer
    Regards
    Padma N

    hi Padma,
    For changing the background colour you will have to make the change in the theme.
    You can download the theme editor plugin for eclipse from SDN. With this plugin, you can make changes to the default themes , save as a new theme
    Or if you are using portal, then goto system administrator, theme editor, select SAP Streamline and change the color in Screen areas -> application, then save the theme with different name.
    Best regards,
    Sangeeta

  • Dynamically Set Subreport Background Color to the Same Value as Main Report Background Color

    I have a report that contains a subreport.  The main report has groupings in it.  I am dynamically setting the background color of the group rows based on an expression.  That part is working fine.  The problem that I am having is that
    I don't know how to get the subreport to "inherit" the background color of the grouping that holds it.
    Basically, I have different row shadings on my report differentiating the groupings except for the rows where the subreport shows.
    How do I go about setting the subreport background color to equal it's contaiing grouping's background color?  Thanks in advance for any and all assistance provided.

    The parameter method given by gpshukla will send the info to the subreport, but you don't need the color parameter in the main report, only the subreport. The trick is in setting the value of that parameter.
    Right-click the cell with the embedded subreport, you can select subreport properties.
    Select Parameters and add a parameter.
    The name column is the name of the parameter in the subreport (color) and value is the value to set it to.
    Set name to "color" (no quotes).
    Set Value to the same expression used to set the background color for the row.
    In the subreport, click the design surface to select the report (not header or footer).
    In the properties pane, select background color and choose expression from the dropdown.
    Type =Parameters!color.Value into the expression builder.
    This will work assuming that background color in the main report row will not change without also refreshing the subreport.
    "You will find a fortune, though it will not be the one you seek." -
    Blind Seer, O Brother Where Art Thou
    Please Mark posts as answers or helpful so that others may find the fortune they seek.

  • How can i set the alternating colors for a table rows

    Dear All,
    Please any one help me how can i set the Alternating colors for Table Rows.
    i created a theam there i set the background alternating color to brown and i set the table design properity to alternating. but it is not reflecting.

    Hi,
    The design property in Table properties should work for your requirement. Select "alternating" value for design.
    Please see the API below:
    design
    Determines the appearance of the table. The property design can take the following values and is represented by enumeration type WDTableDesign.
    alternating - The table rows are displayed alternately in a different color.
    standard - The table background has one color. The individual table rows are displayed with grid net lines.
    transparent - The table background is transparent. The individual table rows are displayed without grid net lines.
    Check whether you have changed the right property or not? Also table should contain more than one rows to test this scenario.
    Regards,
    Jaya.
    Edited by: VJR on Jun 17, 2009 6:43 PM

  • Can I invoke a SubVI in an event? and how do I set the background color of a pipe to #0000ff?

    When I click an image or a glass pipe(which belongs to Industry/Chesmitry category in palette), I want a SubVI to be invoked.
    The purpose is to fetch an OPC-UA data from a web service and to write to it via the service.
    We are building an HMI solution which displays an interactive water plant diagram.
    When users click pipes and motors in the diagram, clicked devices should be turned on and off and change their animations or colors accordingly.
    OPC-UA is for communication with devices.
    I couldn't even set the background color of a pipe to "#0000ff", but setting it to "Red" or "Blue" was possible, and I don't know how to invoke SubVIs in event scripts.
    The documentations in NI.com are confusing and lack depth.
    Even silverlight references are confusing.
    How do I do all of these?

    Hi iCat,
    Can you provide some more information about your current implementation so that we can help to answer your questions. Some questions I have for you are:
    Are you creating this project in the NI LabVIEW Web UI Builder or in LabVIEW?
    How are you publishing your webservice? Is this also in LabVIEW?
    How is your webservice interacting with an OPC-UA server?
    How is the certification set up with OPC-UA so that you can communicate between the server and the client?
    Best Regards,
    Allison M.
    Applications Engineer
    National Instruments
    ni.com/support

  • Set back ground color to a particular cell in table view

    hi,
        iam working on a jspDynpage and have a htmlb table view for which i need a way to set back ground color to a particular cell in table view, the color has to be set based on a value..is there a way to do it without using an iterator...well iam using a  cellRenderer for the table but cant find a way to set the colors...if anyone does have a way please do reply...regards

    You can mention the color in <b>textview</b> as well as <b>Label as follows:</b>
          <htmlb:textView     text          = "<span style='background-color: #00FF00'>My Textview</span>"
                              design        = "EMPHASIZED" />
          <htmlb:label for =  "MyLabel"
                       text = "<span style='background-color: #00FF00'>Label </span>"
                       encode = "false"/>
    Reward each helpful answer
    Raja T
    Message was edited by:
            Raja Thangamani

  • Setting up HP Color Laserjet 5550n with Mac

    I just bought a Laserjet 5550 N. Printer works well when set up through USB. When I try to set up with ethernet:
    1. Green light on printer's ethernet port glows green, and port on router is green as well.
    2. In the Printer Pane of System prefs, I can add through Bonjour, but not through ethernet (when connected with USB
    3. When adding with Bonjour, panel hangs up on Setting up 'hp color laserjet'. I get the options to configure or cancel for several minutes. If I click configure, I can set options for printer, and it appears as a printer. However, I cannot print (printer app tells me that printer is not responding. Also can't get supply levels.
    4. Printer has address of 192.168.1.142. When I try to add usining ethernet and that IP address, it cannot find printer. Router address is 10.0.0.1
    Mac Pro 2009 running 10.9.5
    Thanks

    RabbitSF wrote:
    So my question is: Is there a simple way to just install the 3600 driver for the snow leopard?
    It all depends on the driver files used by the LJ3600. If it uses only a PPD, then you could simply copy the PPD to the /Library/Printers/PPDs/Contents/Resources folder for the Mac's that don't have the driver already installed.
    If there are other files required by the PPD, such as plugins and filters, these are probably located in /Library/Printers/HP. So you could also copy this folder with the PPD to the other Mac's to reduce your setup time.
    Hope this helps you.
    Pahu

  • How to set the Background Color of a Text Field in a Tabular Report.

    Hello,
    I tried to set the Background Color of a Text Field in a Tabular Report.
    But I was not able to change this colur.
    In the report attributes --> column attributes
    I tried already:
    1. Column Formating -- >CSS Style (bgcolor: red)
    2. Tabular Form Element --> Element Attributes (bgcolor: red)
    but nothing worked.
    Can anybody help me?
    I Use Oracle Apex 2.2.1 on 10gR2
    thank you in advance.
    Oliver

    in "Report Attributes" select the column to move to the "Column Attributes" page. In the "Element Attributes" field under the "Tabular Form Element" region enter
    style="background-color:red;"
    I will also check if there is a way to do this via the template and post here again
    edit:
    in your template definition, above the template, enter the following:
    < STYLE TYPE="text/css" >
    .class INPUT {background-color:red;}
    < /STYLE >
    (remove the spaces after the < and before the >)
    change "class" to the class that the template is calling
    (I'm using theme 9, the table has: class="t9GCCReportsStyle1" so I would enter t9GCCReportsStyle1)
    A side-effect of using this second version is that ALL input types will have a red background color--checkboxes, input boxes, etc.
    Message was edited by:
    TheJosh

  • How do you set the font color for a specific entire row inside a JTable?

    How do you set the font color for a specific entire row inside a JTable?
    I want to change the font color for only a couple of rows inside a JTable.
    I've seen some ways to possibly do this with an individual cell.
    Clarification on changing the font color in an individual cell would be helpful too if
    there is no easy way to do this for a row.

    hai,
    Try out with this piece of code.Create your table and assign the renderer to each column in the table.
    CellColorRenderer m_CellColorRenderer = new CellColorRenderer();
    for(int i=0;i<your_JTable.getColumnCount();i++)
    your_JTable.getColumnModel().getColumn(i).setCellRenderer(m_CellColorRenderer);
    class CellColorRenderer extends JLabel implements TableCellRenderer
    CellColorRenderer()     
    setOpaque(true);     
    setHorizontalAlignment(LEFT);
    setVerticalAlignment(CENTER);
    setBackground(Color.white);
    setForeground(Color.black);
    protected void setValue(Object value)
         setText((value == null) ? "" : value.toString());
    public Component getTableCellRendererComponent(JTable table,Object value,boolean isSelected, boolean hasFocus, int row,int column)
         if(isSelected == true)
              setForeground(Color.red);
         else
              setForeground(Color.black);
         setValue(value);
         return this;
    regards,
    bala

  • How can i set the different colors for a different group ui elements

    Hi All,
                  I Created a View Container in that i crated 2 views. In first view i created a group and in second
    view also i created a group. I want to set The First view group header colour as Golden colour and for second view group heder colour as Green colour. Please any one help me on this.
    Thanks&Regards,
    Bhargava.

    Dear GLM,
                         i got that. while creating the theme, in Complex Elements select the group element and  set the primary group header colour to golden and secondary group Header colour to Green and in ur webdynpro application set the Group Design property as Primary Color for which group u want to set the Golden color and set the Group Design property as Secondary Color for which group u want to set the Green color.
    Thanks&Regards,
    Bhargava.

Maybe you are looking for