cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a "Average" Line on a Chart

Former Member
0 Kudos

I'm using Crystal Reports XI

I have a chart such as this (modified as an example):

What I need is to be able to add the green line as shown.  Basically the line is to be located at the average/mean point (86.97. in this case).

Can I do this?  How?

TIA

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Clifton,

The only way I was able to do this was like this:

1) Change your chart type to "Line Chart" first

2) Create a formula for average. Something like this:

Average({database_field})

3) Add this field to the Show Values area. So, the Show values will now have two values, one being the Sum and the other being this formula that shows the average

4) Preview the report and while in the Preview Mode, select the Line that shows the Summary Values. You might have a little trouble clicking on the single line, but that shouldn't be a problem as such

5) After you've managed to highlight the Summary Line in the Chart, right-click it and select "Series Options" > Appearance tab > From the drop-down for 'Selected series' choose "Riser"

There you have it, Bars for the Sum and a Line for the Average.

- Abhilash

Follow us on Twitter

Got Enhancement ideas? Try the SAP Idea Place

Share Your Knowledge in SCN Topic Spaces

Former Member
0 Kudos

That worked, sort of.  🙂

It did give me what I asked for, but there is a small side effect.  The bars are now all one colour.  Any chance you can figure out how to do what you did plus keep the bars in their rainbow colours?

abhilash_kumar
Active Contributor
0 Kudos

Well, I was expecting this question sooner or later.

Unfortunately..this might get a little laborious . Colour Highlight (In the Chart Expert) is your only way out and that involves manually choosing values and colouring them.

-Abhilash

ido_millet
Active Contributor
0 Kudos

A simpler solution is to select one of the bars, right-click, and add a Trendline of type Average.

abhilash_kumar
Active Contributor
0 Kudos

Hi Ido,

You do not have an option to add an Average Line, you only have Moving Average.

-Abhilash

ido_millet
Active Contributor
0 Kudos

Abhilash, It's the first Trendline option.  It is called "Mean".

Former Member
0 Kudos

That was perfect.  Thanks. 

Former Member
0 Kudos

Sorry, Abhilash, but I had to unmark your post as an answer (but did mark it as helpful).  Ido had exactly what I was looking for.

abhilash_kumar
Active Contributor
0 Kudos

No problem Clifton; what matters is the resolution.

For some reason, when I tried Mean, it drew lines at multiple points and I had no clue why!

Anyway, glad Ido was spot on.

-Abhilash

Answers (0)