Solved

Adding a regression formula line to an xy scatter graph

Posted on 2004-03-26
4
1,062 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
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…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

730 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