Author Topic: Graph Bars should display in different colours  (Read 876 times)

Offline aamuktha

  • Full Member
  • ***
  • Posts: 34
  • Forum Citizenship: +1/-0
Graph Bars should display in different colours
« on: 10 Jan 2006 02: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

Offline Boris-A

  • Full Member
  • ***
  • Posts: 43
  • Forum Citizenship: +2/-0
Re: Graph Bars should display in different colours
« Reply #1 on: 10 Jan 2006 04: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>
________________
Boris

Offline mrcool

  • Statesman
  • ******
  • Posts: 265
  • Forum Citizenship: +27/-28
Re: Graph Bars should display in different colours
« Reply #2 on: 10 Jan 2006 10: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

Offline Boris-A

  • Full Member
  • ***
  • Posts: 43
  • Forum Citizenship: +2/-0
Re: Graph Bars should display in different colours
« Reply #3 on: 11 Jan 2006 06: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
________________
Boris

Offline phani1979

  • Community Leader
  • *****
  • Posts: 105
  • Forum Citizenship: +3/-10
Re: Graph Bars should display in different colours
« Reply #4 on: 11 Jan 2006 09:44:52 pm »
Hai
You have a lessong how to color the charts ,check the cognos support
phani

Offline mrcool

  • Statesman
  • ******
  • Posts: 265
  • Forum Citizenship: +27/-28
Re: Graph Bars should display in different colours
« Reply #5 on: 11 Jan 2006 11:34:35 pm »
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

Offline Boris-A

  • Full Member
  • ***
  • Posts: 43
  • Forum Citizenship: +2/-0
Re: Graph Bars should display in different colours
« Reply #6 on: 12 Jan 2006 08: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
________________
Boris

Offline mrcool

  • Statesman
  • ******
  • Posts: 265
  • Forum Citizenship: +27/-28
Re: Graph Bars should display in different colours
« Reply #7 on: 16 Jan 2006 10: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 ???