Solved

Adding a regression formula line to an xy scatter graph

Posted on 2004-03-26
4
1,053 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
Comment Utility
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
Comment Utility
Thanks. Some very strange omissions in Crystal reports IMHO.
0
 
LVL 42

Accepted Solution

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

Expert Comment

by:Dan3D
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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. …
I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

772 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

10 Experts available now in Live!

Get 1:1 Help Now