Still cannot use Legend Palette

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
johnnix
Newbie
Newbie
Posts: 34
Joined: Tue Sep 18, 2018 12:00 am

Re: Still cannot use Legend Palette

Post by johnnix » Tue Dec 11, 2018 6:19 am

Ok, so what can I do to finally have a working legend palette?

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

Re: Still cannot use Legend Palette

Post by Yeray » Tue Dec 11, 2018 2:13 pm

Hello,

I've just tried it in a fresh virtual machine with RAD 10.3 Rio and TeeChart v2018.26 and it seems to work without any issue.
What RAD Studio Edition are you using?
What Windows version are you using?
Do you have a second machine to try it?
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

johnnix
Newbie
Newbie
Posts: 34
Joined: Tue Sep 18, 2018 12:00 am

Re: Still cannot use Legend Palette

Post by johnnix » Wed Dec 12, 2018 9:30 am

Hello,

I do not have another computer to test this, I am using Rio Professional under Windows 10 Home. I am unable to debug this and locate the line of code that generates the issue

Regards

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

Re: Still cannot use Legend Palette

Post by Yeray » Mon Dec 17, 2018 8:31 am

Hello,

We've checked this in some other machines without being able to reproduce the problem in any of them.

Having the sources you should be able to see the line of code where it crashes. I would make sure the sources are being used and I would create the TLegendPaletteTool at runtime in a new simple project. An alternative would be to open the editor at runtime and try to add the tool.
One way or another, if you can make it to crash at runtime and the sources are being referenced, you should be able to see the call stack.
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

johnnix
Newbie
Newbie
Posts: 34
Joined: Tue Sep 18, 2018 12:00 am

Re: Still cannot use Legend Palette

Post by johnnix » Tue Dec 18, 2018 6:42 am

Hello,

Can you please provide more information on how I can make sure sources are used?

Regards

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

Re: Still cannot use Legend Palette

Post by Yeray » Tue Dec 18, 2018 8:06 am

Hello,

In the list of Library paths, make sure the "Sources\VCL" path is used and not the path to the binary install "Delphi26\Delphi26.*\Lib".
Ie, for win32, this is how I have it to use the binary installation:
bds_2018-12-18_08-49-31.png
bds_2018-12-18_08-49-31.png (17.8 KiB) Viewed 27356 times
Note the lines starting with a "dot" aren't recognized and aren't used. I just have them to easily switch between versions.
Also note I use an "Environment Variable" named "TeeChart" $(TeeChart), which I use to point to where I have all the installations (I don't use the default "C:\Program Files (x86)\Steema Software").

If I want to switch to use the VCL sources, I add a "dot" to comment the path I don't want to use and I remove the "dot" from the path I want to use:
bds_2018-12-18_08-55-22.png
bds_2018-12-18_08-55-22.png (17.86 KiB) Viewed 27356 times
Also, make sure the "VCLTee" prefix is present in the "unit scope names" ("FMXTee" for FMX projects).

Then, to check you are using the sources, you can just compile ("Ctrl+F9") a simple project that includes a reference to some TeeChart unit. After that, if you Ctrl+Click the unit name (ie "VCLTee.Chart"), the IDE should jump to the unit declaration.

To test the TLegendPaletteTool I would add a breakpoint at it's Create function:
bds_2018-12-18_09-02-42.png
bds_2018-12-18_09-02-42.png (16.98 KiB) Viewed 27356 times
When you run the test application, the IDE should stop there, and you can debug. F7 to "Trace into", F8 to "Step over", and F9 to continue running.
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

johnnix
Newbie
Newbie
Posts: 34
Joined: Tue Sep 18, 2018 12:00 am

Re: Still cannot use Legend Palette

Post by johnnix » Tue Dec 18, 2018 8:53 am

Hello,

I made the change in the Library path but when I try to compile a simple project I get an error at line 98 of VCLTee.TeeProcs: [dcc32 Fatal Error] VCLTee.TeeProcs.pas(98): F2613 Unit 'TeCanvas' not found. I believe this is where I was stuck last time I tried to compile with sources but did not look into it any further, any thoughts of what could be wrong?

Regards

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

Re: Still cannot use Legend Palette

Post by Yeray » Tue Dec 18, 2018 9:32 am

Hello,
johnnix wrote:
Tue Dec 18, 2018 8:53 am
I made the change in the Library path but when I try to compile a simple project I get an error at line 98 of VCLTee.TeeProcs: [dcc32 Fatal Error] VCLTee.TeeProcs.pas(98): F2613 Unit 'TeCanvas' not found. I believe this is where I was stuck last time I tried to compile with sources but did not look into it any further, any thoughts of what could be wrong?
Let me insist on this and expand it with a screenshot:
Yeray wrote:
Tue Dec 18, 2018 8:06 am
Also, make sure the "VCLTee" prefix is present in the "unit scope names" ("FMXTee" for FMX projects).
bds_2018-12-18_10-31-47.png
bds_2018-12-18_10-31-47.png (17.15 KiB) Viewed 27354 times
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

johnnix
Newbie
Newbie
Posts: 34
Joined: Tue Sep 18, 2018 12:00 am

Re: Still cannot use Legend Palette

Post by johnnix » Tue Dec 18, 2018 9:46 am

Ok, I now have the app compile fine with sources however the line that throws the exception is at VCL.Controls 9551 (procedure TWinControl.CreateWnd). I create the LegendPalette having a button on the form:

Code: Select all

procedure TForm1.Button1Click(Sender: TObject);
var aTool: TLegendPaletteTool;
begin
  aTool := TLegendPaletteTool.Create(chart1);
  // aTool.ParentChart := chart1; ---> same result
  chart1.Tools.Add(aTool);
end;
and once I move the mouse over the chart area I get the exception

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

Re: Still cannot use Legend Palette

Post by Yeray » Tue Dec 18, 2018 11:06 am

Hello,

When the exception occurs, you usually can see and navigate through the Call Stack (by default at the top-left corner) so you can see if there is some invalid parameter being passed to some function, or some array being accessed out of its bounds,...
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

johnnix
Newbie
Newbie
Posts: 34
Joined: Tue Sep 18, 2018 12:00 am

Re: Still cannot use Legend Palette

Post by johnnix » Tue Dec 18, 2018 2:07 pm

Yes but unfortunately I do not know how to use this information
Attachments
Annotation 2018-12-18 160705.jpg
Annotation 2018-12-18 160705.jpg (439.25 KiB) Viewed 27349 times

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

Re: Still cannot use Legend Palette

Post by Yeray » Wed Dec 19, 2018 11:14 am

Hello,

I see in your Call Stack the TTeeCanvas.DoChangedFont method is being called while in the example I run here it calls the TGDIPlusCanvas.DoChangedFont method.
So the difference seems to be in the Render option being used GDI vs GDIPlus.
If I change the Render in the "Options\New Chart" to "GDI" in the design time "Options" window, then I can reproduce the error.

So, could you please check if changing that option back to the default GDIPlus solves the problem for you?
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

johnnix
Newbie
Newbie
Posts: 34
Joined: Tue Sep 18, 2018 12:00 am

Re: Still cannot use Legend Palette

Post by johnnix » Thu Dec 20, 2018 6:22 am

Hello,

I can verify that by setting the GDI+ option for new charts the error is gone, however I really need to work with GDI so if there is a quick fix for that please let me know

Regards

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

Re: Still cannot use Legend Palette

Post by Yeray » Thu Dec 20, 2018 9:44 am

Hello,

I've added it to the public tracker.
http://bugs.teechart.net/show_bug.cgi?id=2135

Also, I'll merge this thread into the initial one.

A workaround could be to set "GDI+" as "Render" at the "New Chart" tab in the design time "Options", and then set the Chart to use GDI:

Code: Select all

  Chart1.Canvas:=TTeeCanvas3D.Create;
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

johnnix
Newbie
Newbie
Posts: 34
Joined: Tue Sep 18, 2018 12:00 am

Re: Still cannot use Legend Palette

Post by johnnix » Thu Dec 20, 2018 2:58 pm

Hello,

I will give your suggestion a try, thank you very much!

Regards

Post Reply