Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Changing Legend sort order - grouped line chart Post Reply Post New Topic
Author Message
Prebanks
Newbie
Newbie
Avatar

Joined: 30 Jan 2012
Location: Canada
Online Status: Offline
Posts: 4
Quote Prebanks Replybullet Topic: Changing Legend sort order - grouped line chart
     Posted: 30 Jan 2012 at 8:31am
Hi.

I'm using CR XI.

I have a line chart with years 2006 to 2010 along the bottom and several lines, each one representing a different value.  I have not been able to figure out how to change the legend sort order so that it is in the same order as the descending values.

Just as an example, let's say that in 2010, the company sold more cars than bikes.  The cars line is on top of the bikes line, where it should be.  The legend, however, is in alphabetical order; bikes then cars.

I tried to change the legend sort order on the Data tab in Chart Expert.  If I select to change for all charts in the group, I get the Data tab, but if I select for this instance only, I don't see a data tab.  That's the first problem.

So my only option there is a manual fix and I would have to change the sort order in all the charts at the same time, which is not what I need to do.  The sort order should change according to the data.  For example, if chart 1 is for the north region and chart 2 is for the south region, the sales will be different.  I need CR to automatically sort the legend in descending order of the most sales in 2010, just as it does for the lines.

Does anyone know how to do this?  There must be a way!

Thank you Smile


Edited by Prebanks - 30 Jan 2012 at 8:31am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 30 Jan 2012 at 9:36am

Not sure exactly how you have this chart set up but sometimes you can use "TopN" sorting in charts. It may become active in if you select the field you are using for "on change of" in the data tab.

IP IP Logged
Prebanks
Newbie
Newbie
Avatar

Joined: 30 Jan 2012
Location: Canada
Online Status: Offline
Posts: 4
Quote Prebanks Replybullet Posted: 31 Jan 2012 at 7:45am
Thank you.  I had assumed that those sort buttons would alter the order of the data, but didn't think they would fix the legend. I'll play around with this and let you know if it works.
IP IP Logged
Prebanks
Newbie
Newbie
Avatar

Joined: 30 Jan 2012
Location: Canada
Online Status: Offline
Posts: 4
Quote Prebanks Replybullet Posted: 31 Jan 2012 at 8:40am
Well, I'm getting closer.  I have resorted the legend according to the order of the lines on the chart, by doing the following:

> chart expert
> data tab
> select field from "On change of" list
> Top N button
> For this group sort "All", based on the same field as I selected from the "On Change of" list, in descending order
> click OK and OK again.

Although this worked, I'm pretty sure it's sorting on the wrong year.  I would like the legend to be sorted descending, according to the values in 2010, not 2006, which it appears to be doing.  Any ideas?

By the way, my apologies if I mislead anyone by saying I have grouped charts.  It's actually an advanced chart that is grouped by one of my data fields.  This produces a new chart for each group automatically.

Thanks again.  I appreciate all offers of help!
IP IP Logged
Prebanks
Newbie
Newbie
Avatar

Joined: 30 Jan 2012
Location: Canada
Online Status: Offline
Posts: 4
Quote Prebanks Replybullet Posted: 31 Jan 2012 at 9:54am
Just an update.... the legend is sorting itself in descending order, using the total counts for all 5 years on the chart, not for an individual year as I previously thought.
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum