Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Chart Help

Status
Not open for further replies.

r9876r

Programmer
Jan 28, 2009
6
US
Hi,

I have a requirement to create either a line graph or any other similar chart using the following input data table.

[pre]
No. Finish Date Month
-------------------------------------
1 11/13/2015 Nov
2 12/18/2015 Dec
3 1/15/2016 Jan
4 3/31/2016 Mar
5 4/1/2016 Apr
6 6/1/2016 Jun
[/pre]
I want the graph something similar to shown in the attachment

Please provide any suggestions or ideas to design

Thanks
Ram
 
 http://files.engineering.com/getfile.aspx?folder=519b00b1-959a-46db-ba23-df5199c96c48&file=LineImg.png
Hi,

This is what it takes to PLOT your data in a chart. I know how to do it in Excel--it's VERY labor intensive, but I don't know how to do it in CR. I can just explain the data that's required.

You basically need a Stacked Bar Chart (that stacks left to right). The y-axis, which will be left to right, is date values, axis values starting with 11/1/2015 through 7/1/2016.

So your data for the horizontal stacks would be 11/13/2015, and then the day difference between each subsequent date and the previous date, 35, 28, 76, 1, 61.

Each of those series fill need to be EMPTY with no borders.

Each series needs a Data Label inside the Top End. The Data Value is the No. in your table.

Frankly, if this were my task, I'd code the solution in VBA, as I suppose you will never know how many rows your data will have.

Oh, yes, here's a major drawback with a chart that plots dates, such as yours, as MONTHS. Month, as we all know, is not an EXACT amount of days, Charts plot grid lines at REGULAR INTERVALS. TILT! There's a disconnect! Months are NOT AT REGULAR INTERVALS.

So take a look at my chart and notice how the Month values don't quite line up.

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Or how about a regular Line Chart with invisible lines and Data Values ABOVE each point? That might be much simpler!

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Hi,

Thank you SkipVought.

Could you please explain little bit more about Line Chart with invisible lines?

Thanks
Ram
 
Download the workbook again to view.

The line has no fill or no color.

Please be clear: I'm suggesting a general method. Someone with CR smarts will need to explain how that can be implemented in CR.

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Another option is to use 6 text objects with a square border (or 6 images you create somewhere else). Then use the horizontal position condition formula of each object to move them to the right (in twips). I would use the month value to move entire months, and then divide the day of the month by the days in that month to get the position within the month, then convert to twips. You have a lot more flexibility this way and you can draw your own images.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks
 
This are the charts from my two attempts in Excel.

You ought to be able to use similar techniques in CR for the Line Chart, but I don't know the specifics.
Untitled_uogunr.png


Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Thank you for taking time and looking at my post.

@Ken Hamady, The images are dynamic number not static, depends on the user selection. some times, there may be only one image and sometimes could be ten or more images.

@SkipVought, Could you please provide some more details on bar chart one than I will try converting to CR.

Thanks
Ram
 
Ram, the Bar Chart is the most difficult and it is not as accurate. I shot from the hip when I posted that solution first, as I've used this technique on occasion when I had complex Gantt charts. If you expect that this chart will have a variable number of rows as time goes on, it will be a pain to maintain.

Please explain your requirement in more detail and explain why the Bar Chart is preferred over the Line Chart.


Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
@SkipVought,
Actually I want the Line graph not bar graph. I saw something relating to bar graph on your message that's why I requested more details on it

@KenHamady,
Now, I am exploring your option. Could you please provide some more details around your idea?

Thanks
Ram
 
Do you have any specific questions about my approach?

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks
 
@Ken, can the Line Chart concept I proposed be implemented in CR?

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Not sure. I have used months as the X axis so you get one summary point per month, but I can't think of a way to make the date something that is both the scale and the measurement. Wouldn't that have to be the Y axis? For me, trying to do this in a chart sounds like fighting against the CR charting engine. When I had to do a GANTT chart in CR I used a row of boxes on a group footer and programmed each box to change color if it fell within the date range of that group.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks
 
Ken the x-axis is date,, y-axis is ANY CONSTANT VALUE. I used 1.

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
The only way I could get the date scale on the X axis was to use a "date axis" chart, a subtype of numeric axis charts. It puts the boxes in the right places but can't label them as shown above. It also gives little control to the axis labels. Those are the types of constraints I expected. With much fiddling someone might get a bit closer.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks
 
Ken,

could you please explain your idea and also twips something you mentioned about. I am not looking for exact same graph shown above. Looking something close to it

Thanks
Ram
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top