Solved

Adding a regression formula line to an xy scatter graph

Posted on 2004-03-26
4
1,054 Views
Last Modified: 2011-10-03
How do I go about adding a formula line to an XY scatter graph in Crystal reports 9? I am able to add the two values to the chart, but cannot add the regression formula line. Please help. Thanks.
0
Comment
Question by:adrianbennett
  • 2
4 Comments
 
LVL 42

Expert Comment

by:frodoman
ID: 10687372
Unfortunately you can't because to the best of my knowledge Crystal supports trendlines only on line charts.

There is a workaround but it's very clumsy.  What you would need to do is to create a separate chart in a section above your scatter graph and then in the section expert check the "Overlay Following Section" option to put your trend chart over the top of the scatter chart.  You can either calculate and graph the trendline manually or create a line chart and insert the regression line then set the primary data lines to transparent (or to the backgroup color).

In order to achieve a clean result you'll need to make sure the xy scales and the total size of both charts are identical.  You'll want to set as much of the overlay chart to transparent as possible and it will still take lots of fine-tuning at 400% zoom to get the remaining lines to overlay each other cleanly.

If you absolutely must do this then the above method will work but IMHO the end result isn't worth the effort it takes.  I would look at other options for representing your data if that's at all possible.

Good luck.

frodoman
0
 

Author Comment

by:adrianbennett
ID: 10687406
Thanks. Some very strange omissions in Crystal reports IMHO.
0
 
LVL 42

Accepted Solution

by:
frodoman earned 125 total points
ID: 10687433
Yea, their graphing capabilities in particular are way overdue for some additional functionality.
0
 
LVL 6

Expert Comment

by:Dan3D
ID: 10810819
I agree that the graphing capabilities are due for some 'overhaul'... and I wrote a lot of the original code!

The big problem with Scatter Charts in Crystal is that the dataset is interpreted as "Many series, each with exactly one marker in it" when what you really want is "one series composed of many markers".  It is impossible to create a regrssion line of a series that has only 1 element.  However, once you can construct this second type, then it is easy to create a linear regression line:  Just go to ChartOptions->General Options and then to the TrendLine tab and select LinearRegression.

I would recommend you download the evaluation version of our CRChart product (which replaces the charting in Crystal Reports). If you use the @SWAP macro you will be able to construct the correct dataset and then add your regression line [Disclaimer: CRChart costs money. I work for the company that makes this product. There may be other solutions available that I am not aware of].

-Dan @ 3D
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now