Custom Chart Display

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Hans Wolfgang
Newbie
Newbie
Posts: 58
Joined: Fri Nov 15, 2002 12:00 am
Location: Naples, FL
Contact:

Custom Chart Display

Post by Hans Wolfgang » Wed Nov 04, 2009 4:35 pm

Please see attached chart. Form of interest is the second form, called "LifeTemp".

With Yeray's help I developed a custom logarithmic display that works on equal ratios rather than equal linear increments. You can see the code in the AfterDraw event. Not sure if this is the best approach. If you see a better method please let me know. I'm not completely satisfied yet. There may need to be additional tics in the left axis. Maybe they will end up being 10, 15, 20, 35, 50, 70, 100, etc.

I realize that the 50 tic is off the chart. It is a bug that I will find and fix.

There are three remaining issues:

1. Please demonstrate the way to draw grid lines that match the TeeChart default grid format, rather than the long dashes of the line property.

2. Could you show me how to move the left axis title away from the custom axis labels, or if necessary, to clear and redraw the title.

3. Please give me a pointer if there is a way to format the axis title and other text to include subscripts and exponents.
Attachments
ENW-Test01.zip
(9.32 KiB) Downloaded 692 times

Yeray
Site Admin
Site Admin
Posts: 9617
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Custom Chart Display

Post by Yeray » Thu Nov 05, 2009 9:52 am

Hi Hans,

1. Oups, I think I suggested you psDash while default grid lines are drawn in psDot.

2. You could do something as explained here.

3. Take look at the demo at All features\Welcome !\3D Canvas\RichText Drawing
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Hans Wolfgang
Newbie
Newbie
Posts: 58
Joined: Fri Nov 15, 2002 12:00 am
Location: Naples, FL
Contact:

Re: Custom Chart Display

Post by Hans Wolfgang » Thu Nov 05, 2009 8:05 pm

Thanks Yeray. Actually it was my own decision to use psDash. I took psDot too literally. It is actually a short dash.

Second link in your message does not work.

From first ink in your message, I dded the following two lines, but they make no change in appearance of my left axis:
TitleSize := 0;
LabelsSize := 50;
Complete, updated demo package is attached.
Attachments
ENW-Test02.zip
(14.14 KiB) Downloaded 722 times

Yeray
Site Admin
Site Admin
Posts: 9617
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Custom Chart Display

Post by Yeray » Fri Nov 06, 2009 12:29 pm

Hi Hans,
Yeray wrote:3. Take look at the demo at All features\Welcome !\3D Canvas\RichText Drawing
Hans Wolfgang wrote:Second link in your message does not work.
No, that's not a link. I'm talking about the New Features Demo program that comes with TeeChart installation. You should be able to find it at Steema programs group.
Hans Wolfgang wrote:From first ink in your message, I dded the following two lines, but they make no change in appearance of my left axis:
TitleSize := 0;
LabelsSize := 50;
You are placing this into OnAfterDraw event. Try it in your FormCreate method.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Hans Wolfgang
Newbie
Newbie
Posts: 58
Joined: Fri Nov 15, 2002 12:00 am
Location: Naples, FL
Contact:

Re: Custom Chart Display

Post by Hans Wolfgang » Mon Nov 09, 2009 8:45 pm

Thanks that works fine for left axis.

For bottom axis I have the same trouble separating the axis title from custom drawn axis labels. In FormCreate() I have the following:

LeftAxis.TitleSize := 0;
LeftAxis.LabelsSize := 10 + canvas.TextWidth( '2000' );
{ the next two lines do not have the desired effect }
BottomAxis.TitleSize := 0;
BottomAxis.LabelsSize := 10 + canvas.TextHeight( '2' );

Demo package is attached.
Attachments
ENW-Test06.zip
(29.12 KiB) Downloaded 699 times

Yeray
Site Admin
Site Admin
Posts: 9617
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Custom Chart Display

Post by Yeray » Tue Nov 10, 2009 1:07 pm

Hi Hans,

Note that in the Left axis you've set the labels to be visible and an increment of 200 so that the automatic labels are not drawn but they reserve the space to be drawn and that looks like a margin.
So, to do the same for the bottom axis, you could add the following at you FormCreate:

Code: Select all

    chLifeTemp.BottomAxis.Labels := true;
    chLifeTemp.BottomAxis.Increment := 200;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Hans Wolfgang
Newbie
Newbie
Posts: 58
Joined: Fri Nov 15, 2002 12:00 am
Location: Naples, FL
Contact:

Re: Custom Chart Display

Post by Hans Wolfgang » Tue Nov 10, 2009 1:40 pm

Perfect, thank you.

Post Reply