Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Synchronizing the scale of two superimposed charts Post Reply Post New Topic
Author Message
sirlansa
Newbie
Newbie
Avatar

Joined: 20 Dec 2006
Location: United States
Online Status: Offline
Posts: 37
Quote sirlansa Replybullet Topic: Synchronizing the scale of two superimposed charts
    Posted: 25 Jan 2007 at 11:41am

My customer wants a bar chart with several line series across the bars. To do this I had to resort to two charts* -- one side-by-side bar and one line chart SUPERIMPOSED one on the other. The foreground chart has transparent background, axes and scales. By careful alignment, I can get the borders of the 2 charts to line up exactly.

The problem now is how to synchronize the scales of the two charts; I had thought that by plotting the same values on both charts (and hiding the ones I dont want to see), the scales would automatically be set to the same max values. This is not the case. The max value for the line chart is consistently lower, in one instance 40% lower.
 
Do you know of a scheme to synch these scales?
 
 
 
* A combo chart would allow me to add only one line series without plotting cumulative values.
Sir Lansa
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 25 Jan 2007 at 11:55am
The Crystal Report chart has formatting options where you can set the min and max scale along the different axis. Right click on the chart, choose Chart Expert and go to the Axes tab.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
sirlansa
Newbie
Newbie
Avatar

Joined: 20 Dec 2006
Location: United States
Online Status: Offline
Posts: 37
Quote sirlansa Replybullet Posted: 25 Jan 2007 at 12:52pm
I should have been clearer. The chart will be drawn many times, for different sets of data. The max value one time might be 450, at another time 200000, so this must be dynamic. If I set the MAX manually to 200000, this would work, but the data on the chart when the max is 450 would be barely visible.
Sir Lansa
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 25 Jan 2007 at 1:01pm
I see what you are saying. Yes, that is a BIG problem (I have it in charts that I've used and it can drive me crazy). Unfortunately, the Min and Max values don't have a custom formula associated with them. So there is no way to do this for now.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
sirlansa
Newbie
Newbie
Avatar

Joined: 20 Dec 2006
Location: United States
Online Status: Offline
Posts: 37
Quote sirlansa Replybullet Posted: 29 Jan 2007 at 11:21am
This time the solution was to create a new formula which is set to the max value of all the plotted variables in the 2 reports. I then plotted this 'MaxPlottedValue' on both charts and then hid it. So far, all the scales I've checked are in synch!
 
Since there is no MAX function available, I had to simulate this function with if then else logic. Tedious, but it works.
Sir Lansa
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 29 Jan 2007 at 12:08pm
So you plotted the max value function and THEN hid it? Wow, very clever. I'm going to play around with that idea.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
Dan3D
Newbie
Newbie


Joined: 25 Feb 2007
Location: United States
Online Status: Offline
Posts: 33
Quote Dan3D Replybullet Posted: 25 Feb 2007 at 7:21pm
This would have been a snap with CRChart, which has scale interlocking capabilties. You could also have started out with a dual-y chart, mapping the bars to Y1 and the lines to Y2.
 
-Dan @3D
 


Edited by BrianBischof - 26 Feb 2007 at 10:32am
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.016 seconds.