COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: krubi on 08 Mar 2011 04:56:18 PM

Title: Adding Trend Lines to a Bar Chart
Post by: krubi on 08 Mar 2011 04:56:18 PM
I would like to add a trend line to a bar chart that I have created.  There are only six bars so it's a very simple chart, but I've never added a trend line before. 

There are several posts about adding a trend line via Chart Annotations -> Baselines, but I'm not sure where I need to go from there.  I don't want a Mean.

Thanks!
Title: Re: Adding Trend Lines to a Bar Chart
Post by: AussiePete2011 on 08 Mar 2011 05:21:09 PM
Hi there

Check this out
https://www-304.ibm.com/support/docview.wss?uid=swg21340501

Also of some relevance is
http://www.ibm.com/developerworks/data/library/cognos/page260.html
http://www.ibm.com/developerworks/data/library/cognos/page102.html

Hope this helps
Cheers
Peter B
Title: Re: Adding Trend Lines to a Bar Chart
Post by: krubi on 11 Mar 2011 12:53:18 PM
Thanks Peter!

I understand how this works mathematically, but I'm not sure how to implement this in Cognos.  From the code you provided, it looks like I should create a data item called "Y".  How do I reflect "Y" in my chart? 

Kim
Title: Re: Adding Trend Lines to a Bar Chart
Post by: krubi on 11 Mar 2011 01:28:07 PM
After looking at the code again...

I'm creating 3 data items - X, Y, and Y'.  Then do I add Y' as a series?

Kim
Title: Re: Adding Trend Lines to a Bar Chart
Post by: AussiePete2011 on 13 Mar 2011 04:42:03 PM
Hi Kim,

Depending on how you want the measure to be dissected, you would use the Series for Y..

Here's a nice example of using series in a chart
http://publib.boulder.ibm.com/infocenter/c8bi/v8r4m0/topic/com.ibm.swg.im.cognos.ug_cr_rptstd.8.4.0.doc/ug_cr_rptstd_id4467cr_rptstd_reptyp_example_create_colu.html#cr_rptstd_reptyp_example_create_column_chart_plot_order_trends

Let me know if I've gone off on a tangent
Cheers
Peter B