Color value labels based on value?

Hi,
I am attempting to track the mileage over time for my automobile lease.  I have created a table that allows for entering the current date and mileage that then calculates the target mileage for that given date and the difference between target and actual mileage.  The table is then represented in graphical form (pic below).
I would like to be able to use the conditional formatting of color to display in the chart so that positive numbers are red (over target mileage) and negative numbers are green (below target mileage).  I can't seem to figure out how to accomplish this conditional formatting of value labels.  It seems like it should be possible to apply conditional cell formatting to labels?!?  Is there a way to achieve this variable colored label display in charts?
Any assistance much appreciated!
Bob

You cannot format points within a series individually.  You can use two series: one positive and the other negative
The main downside is that they won't connect when you switch between them:
D2=IF((B2-C2) >= 0, (B2-C2), "")
E2=IF((B2-C2)<0, (B2-C2), "")
select D2 and E2, then fill down.  You can select the series in the chart to set the color.  I set the stoke color (for the line segment between points) and the point to to white for the Difference series

Similar Messages

  • Change Value A based on Value B in Web UI in cross component

    Hi Friends,
    I have a requirement to populate value A based on selection of value B in differenet component.
    I have a web ui screen to create a complaint ( Component A ). After saving when I am clicking on follow up button, it will take me to next web ui screen ( Component B ) i.e. service order. Here I have a status field and after its selection when I have save. I also want to change value A of component A field.
    Kindly suggest..how can I achive this.
    Regards,
    Narendra Goyal

    Hi Narendra,
    It depends on what the exact fields are. If you change a value in component A and this change goes to the BOL layer, then this changed value should always be accessible in component B if you use the same BOL object and BOL relation to access the data. And you can always change the value from component B and it should already change in component A. The only thing you need to ensure is to call publish_current( ) method on the node where you change the value or call a BOL code modify( ).
    Regards,
    Shiromani

  • I have tried everything! How to change the color of text based on value Acrobat 9

    How can I change the color of the text to red if the value is "Unacceptable" and leave it green for all other rating values? Where can I put it for it to work? Also, Unacceptable is set to an export value of 0.
    var n = +this.getField("NumericSummaryRating").value;
    var a = +this.getField("Rating1.0").value;
    var b = +this.getField("Rating1.1").value;
    var c = +this.getField("Rating1.2").value;
    var d = +this.getField("Rating1.3").value;
    var e = +this.getField("Rating1.4").value;
    if (n == 0) {
        event.value = "Not Rated";
    } else {
    if (a==0 || b==0 || c==0 || d==0 || e==0) {
        event.value = "Unacceptable";
    else {
        if (n>0 && n < 3.0){
            event.value = "Unacceptable";
        else if (n >= 3.0 && n < 3.6) {
            event.value = "Successful";
        else if (n >= 3.6 && n < 4.6) {
            event.value = "Excellent";
        else if (n >= 4.6) {
            event.value = "Outstanding";

    You can add this at the end of the code:
    if (event.value=="Unacceptable") event.target.textColor = color.red;
    else event.target.textColor = color.green;

  • Color a column based on value in another column in tableview

    I am using a tableview iterator to display data in a bsp page. I want to color a cell in particular column (column 4), when a value in another column (column 2) on that same row is greater than 20. I can color the cell in column 2 but am not able to color the cell in column 4. How can I accomplish this?
    This is what I have. Looks like val1 is losing it's value.
    CASE p_column_index.
        WHEN 2.
          ASSIGN p_row_data_ref->* TO <row>.
          ASSIGN COMPONENT 'ZTGT' OF STRUCTURE <row> TO <col>.
          VAL = <col>.
          IF VAL GT '20'.
            val1 = p_row_index.
            p_style = 'celldesign:CRITICALVALUE_DARK'.
          ENDIF.
        WHEN 4.
            if p_row_index = val1.
              p_style = 'celldesign:CRITICALVALUE_DARK'.
            endif.
        WHEN OTHERS.
    do nothing
      ENDCASE.

    The reason val1 is "loosing its' value" is presumably because you have defined it in the method as a local variable. So each time you call the RENDER_CELL_START method it is is newly initialised. So if you make this an instance attribute it will retain its' contents across method calls.
    Cheers
    Graham Robbo

  • ALV Tree - Color Specific Column based on value in that cell?

    Hi Forums,
    I have searched the forum and I am unable to find the answer to my question.
    I am using an ALV tree and I would like to color a cell RED is the value in the cell is negative.
    I have set my field catalog to many different emphasize numbers and no luck either?
      CLEAR ls_fieldcatalog.
      ls_fieldcatalog-fieldname  = 'ORG_TXT'.
      ls_fieldcatalog-coltext    = text-d02.
      ls_fieldcatalog-scrtext_m  = text-d02.
      ls_fieldcatalog-col_pos    = 2.
      ls_fieldcatalog-outputlen  = '30'.
      ls_fieldcatalog-no_out     = 'X'.
      ls_fieldcatalog-emphasize  = 5.
      APPEND ls_fieldcatalog TO et_fieldcatalog.
    I am using 
        gr_alv_tree_control  TYPE REF TO cl_gui_alv_tree
    as my class to display my tree and I have found no methods that would set the color in there either?
    What else could be checked?

    To those interested, i was able to color the TEXT of a First coloumn of the TREE. Using this code:
    That said it will not work without BOTH
           ls_layout_item-fieldname = gr_alv_tree_control->c_hierarchy_column_name.
          ls_layout_item-style   =
                               cl_gui_column_tree=>style_intensifd_critical.
        IF ls_vip_display-vip_diff_tot > 0.
           ls_layout_item-fieldname = gr_alv_tree_control->c_hierarchy_column_name.
          ls_layout_item-style   =
                               cl_gui_column_tree=>style_intensifd_critical.
        ENDIF.
        IF ls_vip_display-vip_diff > 0.
          ls_layout_item-style   =
                               cl_gui_column_tree=>style_intensifd_critical.
        ENDIF.
        ls_layout_item-t_image = '@GZ@'.
        ls_layout_item-style   =
                            cl_gui_column_tree=>style_intensifd_critical.
        APPEND ls_layout_item TO lt_layout_item.
    *   add leaf nodes
        CALL METHOD gr_alv_tree_control->add_node
          EXPORTING
            i_relat_node_key     = lv_parent_id
            i_relationship       = cl_gui_column_tree=>relat_last_child
            i_node_text          = lv_node_text
            is_outtab_line       = ls_vip_display
            it_item_layout       = lt_layout_item
            is_node_layout       = ls_node_layout
          IMPORTING
            e_new_node_key       = lv_new_key
          EXCEPTIONS
            relat_node_not_found = 1
            node_not_found       = 2
            OTHERS               = 3.
    Anybody else who can shed some light to why both are needed OR possibly how I can change the position of the colored text to a different cell?
    Edited by: Keith Warnock on Feb 9, 2011 6:48 PM

  • Populate Value B based on Value A in Web UI

    Hi Friends,
    I have requirement to populate a field value based on other field value.
    I have a view and it consist 2 context nodes.
    When User enters the value in field A ( context node A ), we need to populate the field B ( Context node B ). But the main thing is that get property method of field B is triggering before then get property method of B.
    Kindly suggest how do we achive this.
    Regards,
    Narendra Goyal

    As mentioned before the DO_PREPARE_OUTPUT is a place that will work.
    A little bit more on the background:
    Do not code such stuff in the SET_ methods, as they will be called in the order of the data that is send to the server in the request. You noticed now that GET_A was called after GET_B, but it could change any time depending on the placement of fields on the view. Have a look at the DO_HANDLE_DATA for the FORM_FIELDS.
    An approach I like to take for more time consuming operations on field change:
    Create an event on context node CN1 and register the view controller to react on it. Then in the SET_A fire the event populating the new value as an input parameter.
    Now the handler in the view controller can set a global variable containing the passed value.
    In the DO_PREPARE_OUTPUT I can simply check if the global variable is set and directly work on it. Then clear it.
    It is more work then the method described before, which is really fine and I have used it lots of times. The advantage is that you do less access for fetching the value from the context node every roundtrip.
    cheers Carsten

  • How to make a value changed based upon values selected in dropdown menu

    Hi,
    I am making my first Dreamweaver website using Dreamweaver CS6 on a windows 8 PC.
    I am trying to make a website where the user selects different criteria; in this example an ipod's model, condition and size from three seperate dropdown selections (similar to www.itrado.co.uk) and then based upon these selections a value for their ipod is shown. However i cannot work out how to display a value which remains on the same page and changes based upon the values which have been selected from the dropdown boxes. I was planning on creating a database and then creating a simple code which retrieves the value from the database which corresponds to the three selected values, however i am not sure how to go about doing this.
    Any help would be greatly appreciated.
    Many Thanks,
    Henry

    You need scripts for this. Try this jQuery tutorial
    http://anthonygthomas.com/2010/03/14/display-form-fields-based-on-selection-using-jquery/
    Nancy O.

  • ALV Grid display cell color based on value ( Function Module ALV )

    Hi,
    I want to color the cell based on value eg ( Green = Green color, Red = Red color, Amber = Yello color ).
    Each and every cell is editable after displaying on screen. once the user clicks update button the contents has to be saved to a custom table.
    Can anyone help?
    Advance thanks

    Hi,
    <li>To get color for the cell, you need to set EMPHASIZE field with below information while building fieldcatalog.
    emphasize (highlight columns in color)
    value set: SPACE, 'X' or 'Cxyz' (x:'1'-'9'; y,z: '0'=off '1'=on)
    'X' = column is colored with the default column highlight color.
    'Cxyz' = column is colored with a coded color:
    C: Color (coding must begin with C)
    x: color number
    y: bold
    z: inverse
    <li> To edit the fields, you need to set EDIT = 'X' or INPUT= 'X' . Try those .
    wa_fieldcata-input = 'X'.
    <li>you need to set PF status , to do your remaining requirement.
    <li>For any help, you have to search the forum .
    Thanks
    Venkat.O

  • How to set background color based on values in column grouping

    Hello,
    I have query
    select 1 as CustomerID,'Reality' as Type, 100 as Turnover
    UNION
    select 1 as CustomerID,'Budget' as Type, 120 as Turnover
    UNION
    select 2 as CustomerID,'Reality' as Type, 140 as Turnover
    UNION
    select 2 as CustomerID,'Budget' as Type, 120 as Turnover
    I have matrix, where in rows are customers, there is columngroup based on field Type and in details are summaries of Turnover. I need to change background color of Reality field, when lower than Budget. How can I do that please ?

    Hi volyn,
    After testing the issue in my own environment, we can use custom code to achieve your requirement. For more details, you can refer to the following steps:
    Copy the custom code below and paste it to your report. (Right-click report>Report Properties>Code)
    DIM PreviousValue AS Decimal
    Dim CustomerID AS String = ""
    Public Function  GetPreviousValue(byval Val as Decimal, byval CusID as string)  as Decimal
    DIM Local_PreviousValue AS Decimal
    IF CustomerID <> CusID THEN
    CustomerID  = CusID 
    PreviousValue  = val
    Local_PreviousValue  = 0
    ELSE
    Local_PreviousValue =  val - PreviousValue 
    PreviousValue  = val
    END IF
    return Local_PreviousValue 
    End function
    Click the cell which contains [Sum(Turnover)] value, modify the expression of BackgroundColor property to like this in the Properties Window: 
    =iif(Code.GetPreviousValue(Fields!Turnover.Value,Fields!CustomerID.Value)<0,"Brown","White")
    In this scenario, you can change Brown color to any color you like. The following screenshot is for your reference (I added some data to make it more clearly):
    If you have any other questions, please feel free to ask.
    Thanks, 
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Color report rows based on a value in that row

    I would like to Color report rows based on a value in that row.
    For examplle with the "EMP" table:
    I would like job=MANAGER to be red and job=CLERK to be green etc etc
    The other example I found only had the option of one color either the highlight or the default color.
    I am looking for a way to do multiple colors.

    Hi,
    In the row template, you can use #1#, #2#, etc to indicate where a field in the report needs to be output. This does not have to be plain text - ie, you can use it within style tags if you like.
    So, take a query like:
    SELECT EMPNO,
    ENAME,
    DEPTNO,
    DECODE(DEPTNO, 10, 'green', 20, 'red', 30, 'cyan', 'white') BG_COLOUR
    FROM EMPYou get columns 1=empno, 2=ename, 3=deptno and 4=bg_colour. In the row template, you can then do:
    Before Rows setting (sets up the table):
    &lt;table&gt;
    &lt;tr&gt;&lt;td&gt;ID&lt;/td&gt;&lt;td&gt;Name&lt;/td&gt;&lt;td&gt;Dept&lt;/td&gt;&lt;/tr&gt;After Rows setting (closes the table):
    &lt;/table&gt;Row Template 1 (used for ALL rows):
    &lt;tr style="background-color:#4#;"&gt;&lt;td&gt;#1#&lt;/td&gt;&lt;td&gt;#2#&lt;/td&gt;&lt;td&gt;#3#&lt;/td&gt;&lt;/tr&gt;Then, for every row, the colour that has been calculated using the DECODE function will be used in the style tag to colour the background for the entire row.
    How you determine the colours is up to you. I've used DECODE here, but you could use a field on the DEPT table to hold this and use this in your SQL statement.
    Andy

  • SSRS Hide one data value label in chart legend

    Is it possible  to hide one value in the legend? I've got a stacked bar chart, but there's one value that I don't want to display in the Legend. Is it possible to hide this particular color and label in the legend?
    Thanks,
    Chris

    Hi Chris,
    Yes. In Reporting Services 2005, you could add a filter to hide one value label in the chart legend. This can be done with the following instructions:
    In Report Designer, open the chart properties dialog box and go to Data tab.
    Double click the item in the Series groups to open the Grouping and Sorting Properties dialog box.
    Switch to the Filter tab. Add a filter using the following setting:
    Expression: =Fields!<FieldName>.value
    Operaiton: !=
    Value: =”value”
    If you have any further questions, please let me know.
    Thanks.
    ***Xiao Min Tan***Microsoft Online Community***

  • How to generate controls dynamically based on value stored in database using mvc4?

    In my database, i have a field called control_ids corresponding to  text box, dropdownlist, radiobuttonlist etc. My goal is to
    create controls dynamically based on value of control_id-field in table. Anybody please help me how to create the controls dynamically in MVC 4 for this scenario.

    In your view you could do something like that:
    foreach (var field in Model.FormStruture.fields)
    <div class="editor-label">
    <label for="@field.Name">@field.Descricao</label>
    </div>
    <div class="editor-field">
    <input class="text-box single-line" id="@field.Name" name="@field.Name" type="text" value="@field.Valor" data-rules-required="@field.Mandatory.ToString().ToLower()" data-rule-number="@field.Tipo.Equals(SiB.OCR.Documentos.Modelo.TipofieldDocumento.Numerico).ToString().ToLower()" title="@field.Descricao" />
    </div>
    if (!String.IsNullOrEmpty(field.Format))
    @:<script type="text/javascript">$("[email protected]").mask("@field.Format");</script>

  • Populating values in dropdown based on values selected in second dropdown.

    Hi,
    I  have two listboxes on the screen. Based on value chosen in first dropdown, I want to populate the values to be selected in second dropdown. How can i achieve this? I would be glad if anyone can help me out with this requirement.
    Thanks,
    Ameet

    <font color=blue>Hi,
    <li> Place 2 input fields on screen.
    <li>Set Listbox property as it is shown in the below link.
         <a href="http://2.bp.blogspot.com/_O5f8iAlgdNQ/SmPSPnRa0tI/AAAAAAAAFCQ/wW_URP-ld6o/s1600-h/drop_down-770536.JPG" target="_new">link to dropdown setting</a>
    <li>Set function code to first dropdown box to trigger event when you select value from first dropdown box. So that second one is changed.
    <li>Declare variable like below in TOP include of the module pool program.
    <pre>DATA: g_drop_1 TYPE char10,
          g_drop_2 TYPE char10,
          ucomm    TYPE sy-ucomm.
    TYPE-POOLS vrm.
    DATA: name  TYPE vrm_id,
          list  TYPE vrm_values,
          value LIKE LINE OF list.</pre>
    <li> Use screen flow logic of the screen like below
    <pre>"PROCESS BEFORE OUTPUT.
    PROCESS BEFORE OUTPUT.
    field g_drop_1 MODULE drop_down_1.
    field g_drop_2 MODULE drop_down_2.
    "PROCESS AFTER INPUT.
    PROCESS AFTER INPUT.
    field g_drop_1.
    field g_drop_2.</pre>
    <li>Corresponding code for two drop down boxes.
    <pre>&----
    *&      Module  DROP_DOWN_1  OUTPUT
    MODULE drop_down_1 OUTPUT.
      CLEAR: list[],g_drop_2.
      name = 'G_DROP_1'.
      value-key  = '1'.
      value-text = 'value_1'.
      APPEND value TO list.
      CLEAR  value.
      value-key  = '2'.
      value-text = 'value_2'.
      APPEND value TO list.
      CLEAR  value.
      value-key  = '3'.
      value-text = 'value_3'.
      APPEND value TO list.
      CLEAR  value.
      value-key  = '4'.
      value-text = 'value_4'.
      APPEND value TO list.
      CLEAR  value.
      CALL FUNCTION 'VRM_SET_VALUES'
        EXPORTING
          id     = name
          values = list.
    ENDMODULE.                 " DROP_DOWN_1  OUTPUT
    *&      Module  DROP_DOWN_2  OUTPUT
    MODULE drop_down_2 OUTPUT.
      CLEAR list[].
      name = 'G_DROP_2'.
      CASE g_drop_1.
        WHEN 1 OR 2.
          value-key  = '1'.
          value-text = 'text1'.
          APPEND value TO list.
          CLEAR  value.
          value-key  = '2'.
          value-text = 'text2'.
          APPEND value TO list.
          CLEAR  value.
        WHEN 3 OR 4.
          value-key  = '3'.
          value-text = 'text3'.
          APPEND value TO list.
          CLEAR  value.
          value-key  = '4'.
          value-text = 'text4'.
          APPEND value TO list.
          CLEAR  value.
      ENDCASE.
      CALL FUNCTION 'VRM_SET_VALUES'
        EXPORTING
          id     = name
          values = list.
    ENDMODULE.                 " DROP_DOWN_2  OUTPUT</pre>
    Thanks
    Venkat.O</font>

  • Need to change color of one column's value depending on the other column

    Hi,
    i have a search form which displays two column values
    First column value's colour should be based on second column's value
    For example, if second column has values 'Active', 'Inactive' and 'Pending'
    If 'Active' , the first column value's color sholud be 'red'
    If 'inacitve, another color ....
    Thanks in advance,

    Hi!
    What we did was we added a column on the VO that returns kind of a css part (for example if a column value is 'Active' the value of this column should be "background-color:rgb(255,0,0);")
    Than you use something like this on your column:
    inlineStyle="#{row.StatusStyle}"where StatusStyle is the name of the column with "background-color:rgb(255,0,0);" value.
    The problem here can be that the background color doesn't cover the whole column but only the text in it (so if it is null, the color is default).
    If you want the whole column to be of this color you use something like this:
                                        <af:column ...>
                                          <afh:tableLayout ...>
                                            <afh:rowLayout ...>
                                              <afh:cellFormat inlineStyle="#{row.StatusStyle}" ...>
                                                <af:outputText ...>
                                                </af:outputText>
                                              </afh:cellFormat>
                                            </afh:rowLayout>
                                          </afh:tableLayout>
                                        </af:column>Basically you put another table layout inside a column instead just a outputText (or whatever control you use)
    Hope this is understandable and it helps :)
    It works for us.
    BB

  • Need to display different colors for Actuals and forecasting values in WAD

    Hi Gurus,
    My requirement in the report is, I need to display different colors for particular values like Actuals(say value type 10) and for forecasting values(say value type 20) , and data will uploaded from flat file.
    Scenario : If I upload the data for March Month, I receive actual values upto March(Jan to March month) and from April to Dec(Forecast values with value type 20),  Every month I will be getting file and similarly for subsequent months, i will get current month actual values and forwarding months forecasting values,
    Now , my requirement is, When ever i execute the Report, Say if i execute for April Month, Upto April( Jan to April for actual values should be displayed in one color) and from May to Dec ( forecast values should be displayed in different color).
    I had tried with following options like exceptions and could not display , as it runs based on key figure values where as my requiremnet is based on the CALMONTH , i need to show different colors for both actual and forecast values.
    Kindly, help me out from this,
    Thanks

    Hi,
    it is not necesseary that you need to do that in WAD , you can do the same in BEx platform, Since WAD is build above the bex reports. so automatially any changes done in Report will be replicated in WAD
    Go for Exceptions in Bex. Give some range for Actuals and Forcasting at the creation of the exception.
    if you do those changes in BEX automatically it will replicate in the WAD.
    for more information please read this link
    http://help.sap.com/saphelp_nw04/helpdata/en/68/253239bd1fa74ee10000000a114084/content.htm
    hope this will solve your problem.
    Santosh

Maybe you are looking for