COGNOiSe.com - The IBM Cognos Community

Legacy Business Intelligence => COGNOS ReportNet => Topic started by: aamuktha on 10 Jan 2006 03:29:56 AM

Title: Graph Bars should display in different colours
Post by: aamuktha on 10 Jan 2006 03:29:56 AM
hi Friends ,


   Bars on graphs should be color-coded R/Y/G (R-red;Y-Yellow;G-Green)

case
when
[actual_value]>=[Target_value]  then (1)
when [actual_value]<=[Target_value] then (2)
else (3)
end

1--green colour bar should display in graph
2--red colour bar should display in graph
3--Yellow colour bar should display in graph


can anybody suggest me the approach


thanks
aamuktha
Title: Re: Graph Bars should display in different colours
Post by: Boris-A on 10 Jan 2006 05:50:48 PM
Here, try this, maybe it'll inspire you.

<report xml:lang="en-ca" xmlns="http://developer.cognos.com/schemas/report/1/"><!--RS:1.1-->
   <layoutList>
      <layout>
         
      <pageSet>
            
         <page name="Page1">
               <pageBody><chart refQuery="Query1_chart">
                     <chartBody/>
                     <title render="false">
                        <text/>
                     </title>
                     <subtitle render="false">
                        <text/>
                     </subtitle>
                     <footer render="false">
                        <text/>
                     </footer>
                     <legend>
                        
                        <itemTruncationText>
                           <text/>
                        </itemTruncationText>
                     </legend>
                     <axis axisPosition="X">
                        <labels/>
                        
                     </axis>
                     <categoryItemTruncationText>
                        <text/>
                     </categoryItemTruncationText>
                     <axis axisPosition="Y1">
                        <labels/>
                        
                     </axis>
                     <columnChart depth="0" standardType="standard"/>
                     <chartLevel refLevel="EmployeeID"><queryItemRef refItem="EmployeeID"/><chartText><queryItemRef refItem="EmployeeID" content="label"/></chartText></chartLevel><chartMeasure><chartText><queryItemRef refItem="Revenue LOW" content="label"/></chartText><member refMember="Revenue LOW"/></chartMeasure><chartMeasure><chartText><queryItemRef refItem="Revenue HIGH" content="label"/></chartText><member refMember="Revenue HIGH"/></chartMeasure></chart>
               </pageBody>
            </page></pageSet></layout>
   </layoutList>
<modelConnection name="/content/package[@name='Northwind']/model[@name='model']"/><querySet xml:lang="en-ca"><BIQuery name="Query1"><cube><factList><item aggregate="none" refItem="Revenue LOW" isHeader="true"/><item aggregate="none" refItem="Revenue HIGH" isHeader="true"/></factList><dimension name="EmployeeID"><level name="EmployeeID"><item aggregate="none" refItem="EmployeeID" key="true" isHeader="true"/></level></dimension></cube><tabularModel name="Tabular Model1"><dataItem name="EmployeeID" aggregate="none"><expression>[Report one].[Employee region].[EmployeeID]</expression></dataItem><dataItem name="Revenue LOW" aggregate="total"><expression>IF(TOTAL([Report one].[Orders Facts].[Revenue])&lt;80000)
THEN([Report one].[Orders Facts].[Revenue])
ELSE(0)</expression></dataItem><dataItem name="Revenue HIGH" aggregate="total"><expression>IF(TOTAL([Report one].[Orders Facts].[Revenue])&gt;=80000)
THEN([Report one].[Orders Facts].[Revenue])
ELSE(0)</expression></dataItem></tabularModel></BIQuery><BIQuery name="Query1_chart"><cubeReference refQuery="Query1"/><summary><dataCells><item refItem="Revenue LOW"/><item refItem="Revenue HIGH"/></dataCells><columnEdge><level refLevel="EmployeeID"><item refItem="EmployeeID"/></level></columnEdge><rowEdge><cellMembers/></rowEdge></summary></BIQuery></querySet></report>
Title: Re: Graph Bars should display in different colours
Post by: mrcool on 10 Jan 2006 11:31:56 PM
Hi...Iam using Oracle database and the example you have sent is not working...Can you please send this again...






Thanks,
S
Title: Re: Graph Bars should display in different colours
Post by: Boris-A on 11 Jan 2006 07:05:38 AM
Of course you will not be able to execute the report.. :o  :o
The chances that you have the same databases with the same names as I do are quite slim.  I posted this report specification to show how I would have approached the problem, look at what I did with the "facts" and the bar chart and hopefully it'll inspire you.

Cheers
Title: Re: Graph Bars should display in different colours
Post by: phani1979 on 11 Jan 2006 10:44:52 PM
Hai
You have a lessong how to color the charts ,check the cognos support
phani
Title: Re: Graph Bars should display in different colours
Post by: mrcool on 12 Jan 2006 12:34:35 AM
Hi...we know how to color the charts but the question posted by her is how to apply dif colours with different conditions in single graph... :D



Thanks,
S
Title: Re: Graph Bars should display in different colours
Post by: Boris-A on 12 Jan 2006 09:56:58 AM
In cognos8 there is a conditional palette... but in reportnet, only the option i suggested might help... that I can think of
Title: Re: Graph Bars should display in different colours
Post by: mrcool on 16 Jan 2006 11:36:02 PM
Hi Boris...dnt we have any other option reportnetMR2...?Can u send me one more example...I want to try again...Iam not clear with ex u have sent me...can u send me an ex in Gosales with oracle DB if u dnt mind...
thanks in advance...


Thanks
S ???