Page 2 of 2

Re: Still cannot use Legend Palette

Posted: Tue Dec 11, 2018 6:19 am
by 16584466
Ok, so what can I do to finally have a working legend palette?

Re: Still cannot use Legend Palette

Posted: Tue Dec 11, 2018 2:13 pm
by yeray
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?

Re: Still cannot use Legend Palette

Posted: Wed Dec 12, 2018 9:30 am
by 16584466
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

Re: Still cannot use Legend Palette

Posted: Mon Dec 17, 2018 8:31 am
by yeray
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.

Re: Still cannot use Legend Palette

Posted: Tue Dec 18, 2018 6:42 am
by 16584466
Hello,

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

Regards

Re: Still cannot use Legend Palette

Posted: Tue Dec 18, 2018 8:06 am
by yeray
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 22887 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 22887 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 22887 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.

Re: Still cannot use Legend Palette

Posted: Tue Dec 18, 2018 8:53 am
by 16584466
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

Re: Still cannot use Legend Palette

Posted: Tue Dec 18, 2018 9:32 am
by yeray
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 22885 times

Re: Still cannot use Legend Palette

Posted: Tue Dec 18, 2018 9:46 am
by 16584466
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

Re: Still cannot use Legend Palette

Posted: Tue Dec 18, 2018 11:06 am
by yeray
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,...

Re: Still cannot use Legend Palette

Posted: Tue Dec 18, 2018 2:07 pm
by 16584466
Yes but unfortunately I do not know how to use this information

Re: Still cannot use Legend Palette

Posted: Wed Dec 19, 2018 11:14 am
by yeray
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?

Re: Still cannot use Legend Palette

Posted: Thu Dec 20, 2018 6:22 am
by 16584466
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

Re: Still cannot use Legend Palette

Posted: Thu Dec 20, 2018 9:44 am
by yeray
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;

Re: Still cannot use Legend Palette

Posted: Thu Dec 20, 2018 2:58 pm
by 16584466
Hello,

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

Regards