About Me

My photo
Software Developer and ideas man!

Tuesday, June 7, 2011

Look - I can't read the x-axis labels on my CR Chart!

Ever had the problem with your Crystal Report charts where the datapoints on your chart are too numerous and the x-axis labels become illegible because they all become scruntched up together.  This is primarily for charts that have greater than 100 datapoints.

Well I did and posted the Sap forums for an answer -
http://forums.sdn.sap.com/thread.jspa?threadID=1922787&tstart=0

Anyway, I was forced to come up with an alternative approach for my stacked area and line charts using the charts shipped with Crystal. 

What I did was develop 2 charts to display the same information.  One of the charts was suppressed depending on the number of datapoints to be plotted - so if the number of datapoints exceeded 20 datapoints, I suppress the chart that has the "Show Group Axis" option enabled - this appears to be the sweet spot for readability for my charts using the system default datetime formatted axis label.


With the chart that has the "Show Group Axis" unchecked, I then inserted "Summary" text boxes below the x-axis to display the Minimum and Maximum datetimes for the datapoints.  This set the start and end axes points and lined up perfectly with the start and end of the chart.  As with the duplicate chart, these were suppressed if the number of datapoints was less than 20.

I then inserted a "Data date" field in the middle of the x-axis to indicate the middle datetime for the datapoint range and inserted the following script for the "Display string".

 
So this report  


became
Let me know if you find this useful or need further info on any of the steps above.  

P.S. One further note - I am using Crystal Reports 13.0.1.220 targetted at Visual Studio 2010.

No comments:

Post a Comment