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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TQRChart with dotted lines?

Status
Not open for further replies.

TimSNL

Programmer
Sep 11, 2001
119
AU
Hello,

I am trying to use a TQRChart as part of a printout, which will come out of a black and white laser printer. I have 3 lines on the line graph and simply want the lines solid, dotted and dashed so we can distinguish them.

There does not seem to be a setting to alter the type of the line (changing the colour will not help)

Any ideas?

Tim
 
Hi Tim,

Double-click the TQRChart to go into the Chart Editor. Choose the Series tab at the very top. Select the series you want to alter from the combo box. Click the 'Border' button and then you can select a style e.g. dots, dashes etc. Hope this helps

Clive
:)
 
Thanks Clive ... but it does not work and I think I have found the problem.

In D5 the Series|Format tab has some stuff on it including BORDER, COLOR, etc.
In D6 the Series|Format tab has nothing on it, it is blank!

Is TeeChart shareware and you have to buy the full version to get the Format tab? That Sucks! How can you use it for a black and white printout if you can't tell the lines apart?! [machinegun]

Tim
 
Instead of using three lines as your three different graph series, why not use one line, one point or bubble and one arrow. These three series types are going to be distinguishable even on a black and white printer. Arte Et Labore
 
Tim,

You should have the same functionality as me cos I am using Delphi 6 Professional. TeeChart comes as standard with Delphi 6 (you can buy TeeChart Pro - but for this problem TeeChart Pro is unnecessary!).

From scratch:
1) Drop the TQRChart component on your form
2) Double-click the QRChart to open the "Editing QRDBChart" dialog
3) Make sure the upper tab reads "Chart" and the lower tab reads "Series", then click the "Add" button.
4) Select your Line graph or whatever and click "OK"
5) Repeat this process to add as many Series as desired
6) Click the upper tab "Series" and the lower tab "Format"
7) You should see a group box titled "Line:" which contains several buttons and other controls
8) First, select the appropriate Series from the drop-down box, then click the "Border" button
9) The "Border Color Editor" should appear from which you can choose a style and width, to enable you to distinguish one series from another.

I apologise if this is exactly what you did anyway! I don't mean to be patronizing. If you still cannot see any options under the "Format" tab (after the above process) then try changing the properties at run-time by using the following commands:

Code:
  Series1.LinePen.Style := psDash;
  Series2.LinePen.Style := psDot;
  Series3.LinePen.Style := psSolid; {Default}

OR try:

Code:
  Series1.LineBrush := bsCross;
  Series2.LineBrush := bsBDiagonal;
  Series3.LineBrush := bsVertical;
  {Check out TBrushStyle in the help for more styles}

Hope this helps! ;-)
 
Clive, thanks for your detailed post. I get to point (6) and can't go any further because the format tab is blank. Game Over.
I have tried
Code:
Series1.LinePen.Style := psDash;
and it works fine in print preview, but all lines come out solid when I do the actual printout.
Code:
LineBrush
only works in 3D graphs, I just want a simple 2D graph with 3 lines on it.
I am using "Delphi Professional Version 6.0 (Build 6.240) Update Pack 2". Is this the same build you are using?

Eric, can you please explain youe idea a bit more, I don't quite understand what you mean. (My data comes from 2 different datasets).

Thank you both for your help.
[pc]
Tim
 
Okey dokey, you say that your graph contains three lines. Each of these lines is a series. When you create a series, you can select what type it is (eg, bar, line, pie). The choice you make only refers to that series and not to the entire chart. This means that you could make a graph containing three different styles of series that work in the same way (i. across the chart like a line), in this case, a line, an arrow and a bubble/point style series. Arte Et Labore
 
Tim,

I've done a bit more digging and found the following 2 excerpts from the TChart User Guide found in the Delphi helpfiles. By the way, I use Delphi Professional 6.0 (Build 6.163) on a Windows 2000 OS.


"Increasing resolution:
The metafile format is not aware of the "resolution" concept. This is means resolution information is not stored inside the metafile image. You can modify the Chart "resolution" *before* printing,
by setting this property:

Chart1.PrintResolution := -100 ;

Negative values (like -100 above), represent the porcentual increment in resolution. Zero means "wysiwyg".
More resolution is obtained by making all Chart fonts smaller and thinner lines. The metafile size is bigger when using more resolution. Increasing resolution can improve inaccuracy in buggy printer drivers calculations.


and

"Printing non-solid lines:
In some printer / windows combinations, non-solid pen lines such as "dot" or "dash" will be printed as solid. This happens specially in some HP Laserjet printers. It seems the only workaround is to set the Chart Pen Width properties to Zero:

Chart1.LeftAxis.Grid.Width := 0;

Increasing resolution ( see above ) can make the printer to show non-solid lines."



Hope these help ;-)
 
Well, over the weekend I think I found the problem.

I tried it on a mate's system whom also has D6 and everything worked fine. He had controls on the FORMAT tab and he also had a POINTS tab which is also missing from by TeeChart editor dialog [spineyes].

I had my complete project with me so I loaded it on, set the 3 lines to have points as circle, triangle and square, then compiled and saved.

So the graph problem is solved for now, my D6 will compile this unit ok without destroying the way the graph was setup on the other system. I guess there must be something wrong with my D6 installation?!

Thankyou so much for your help!
This type of probelm (when something in the IDE going AWOL) is very confusing as the IDE is normally the last thing I would suspect.

Tim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top