ChartEditor: Available Series List in Function

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
MikeD
Newbie
Newbie
Posts: 30
Joined: Mon Jun 25, 2007 12:00 am

ChartEditor: Available Series List in Function

Post by MikeD » Fri Oct 29, 2010 3:40 pm

I am moving my processing to a new version. My old processing was highly dependent upon me to build the contents of the lists and did many other things. As part of the new processing I have adopted all the TChart design capabilities including a move to using Data Sets. This means that I am now using TDBChart instead of TChart. I am currently using the latest version 8 update of TChart.

Everything is working fine except one thing: In the ChartEditor, I have a series that is a function along with several other series that are sourced by a Data Set. When I go to set the source series for the function (Data Source tab, Source Series tab), the Available series list is empty. I am using the TDBChart processing as part of a DLL and the program model is Multiple Document Interface (MDI). When I create the TDBChart at run-time, the Owner is set to the application's Main Form. You should note that as a test, the Design Time Editor works fine (I do not use it to design the charts -- the series are added at run-time), it is only when I am running it at Run Time do I have this problem.

As a test case will be very time consuming and might not be possible, can you give me any guidance on how the Available List for the Function is populated? Specifically, could you advise me as to what circumstances permit a Series to be added or omitted from the list. I have tried for a full day (without any success) to try and get this to work. I am completely out of ideas and would appreciate any advice you could give me regarding this.

Thanks for the help.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: ChartEditor: Available Series List in Function

Post by Narcís » Wed Nov 03, 2010 12:36 pm

Hi MikeD,

If it works at designtime but not at runtime the problem might be some unit uses missing in your project. To be able for us to give a more accurate reply we should need to reproduce this. Could you please try arranging a simple example project we can run "as-is" or let us know the exact steps we should follow to reproduce the problem here?

Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

MikeD
Newbie
Newbie
Posts: 30
Joined: Mon Jun 25, 2007 12:00 am

Re: ChartEditor: Available Series List in Function

Post by MikeD » Wed Nov 03, 2010 11:39 pm

I included all the units that the ChartEditor source included (as pragmas since this is C++).

As I said, I don't think I can work this up as a test case as the TChart processing is in a DLL (along with about 12 other DLLs). I was hoping to get some idea of why a series might be omitted from the list (for the function), but is drawn correctly in the displayed chart. It most likely has to do with something that is done when the ChartEditor gets the Series information from the chart. I was hoping that you could give me some info in which to narrow down the processing as I am "blind" as to what is going on inside of ChartEditor.

If you have any ideas, please let me know as I do not have any way to proceed on this. As I said, I tried to narrow this down for an entire day and did not have any success.

Thanks,

Pep
Site Admin
Site Admin
Posts: 3272
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Re: ChartEditor: Available Series List in Function

Post by Pep » Fri Nov 05, 2010 11:00 am

Hi Mike,

ok, it's difficult to say some information about it without getting the problem here. I understand your project could not help to us to find where is the problem, or maybe will be complicated to reproducde (due to the DLLs).
In any case, we're going to try to reproduce the problem here by creating a new project (delphi code) which does at least the same than yours (use same number of Series and the same Functions) so we can see if it's a bug or just a missing thing, but to do this we need more info about it.
Would you be so kind to send to us a little part of code where you create the Series, the functions and also where the DataSource is assigned ?

MikeD
Newbie
Newbie
Posts: 30
Joined: Mon Jun 25, 2007 12:00 am

Re: ChartEditor: Available Series List in Function

Post by MikeD » Sat Nov 06, 2010 6:35 pm

Okay, I was able to create a test case. There are two projects in the test case: An MDI and a DLL.

Instructions:
1. After compiling both modules, run the MDI. The MDI processing will initiate the Form processing that contains the chart. The form is located in the DLL. (I am not sure the DLL has anything to do with this, but I included as I use it).
2. Double click on the chart to open the ChartEditor.
3. Add a Line series.
4. Add a Function series (like Add).
5. Go to the Data Source tab for the Function. The series is missing.

Note: If you comment out the call to Replace_Chart in DLLUnit, and recompile, it will work correctly. The problem has something to do with the chart replacement.
Attachments
Test Case.zip
(28.98 KiB) Downloaded 728 times

Pep
Site Admin
Site Admin
Posts: 3272
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Re: ChartEditor: Available Series List in Function

Post by Pep » Thu Nov 11, 2010 11:14 am

Hi Mike,

thanks for the Test project, I've been able to reproduce the problem here. For the moment I've not found the cause of this behaviour, but looking at the code, why don't you just call "DBChart->ClearChart();" into the Replace_Chart method instead of delete the component and recreate it again?

I've test it and using this call it works fine.

MikeD
Newbie
Newbie
Posts: 30
Joined: Mon Jun 25, 2007 12:00 am

Re: ChartEditor: Available Series List in Function

Post by MikeD » Thu Nov 11, 2010 4:37 pm

I am creating the DBChart in another location. There are times that I will be using the chart without a visible panel. For example, if I need an output jpeg file, I will create the DBChart, load the chart, output the jpeg file, and then delete the DBChart, all without actually displaying the chart. Due to the nature of my processing, I wanted to create the report independent of the use, and in only one location. I have other types of reports as well as chart reports, so I have a single report framework.

For the test case I gave you, the chart is already created and loaded before I realize that it will be displayed, thus the replacement. Due to the amount of loading for the chart report (custom datasets, options, other data, etc.), it is not practical to reload the DBChart that is contained on the display panel.

As I noted to you, all appears to work correctly in the DBChart and most works correctly in the ChartEditor.

Please let me know if you need any further information.

miked
Newbie
Newbie
Posts: 8
Joined: Mon Feb 14, 2011 12:00 am

Re: ChartEditor: Available Series List in Function

Post by miked » Mon Feb 14, 2011 4:51 pm

Do you have any status on this problem? If not, do you have any information about the problem that would help me detour it.

In a previous post you suggested that I use a ClearChart() call. The problem with this is that when I do this call (I tried it), the TChart processing deletes the TDataSets that I previously created. I could not find a way around this deletion.

Another issue that I face is that I will create the TChart in three different modes: internally for direct output, for design, and finally for viewing. In my processing, I create the report internally first as this is the most common processing. After creating the report, I then determine the use, and if it is to be visual, I then do the design or view processing. In the latter two cases, if I do a ClearChart, I have to completely rebuild the chart.

Any help that you can give me would be appreciated.

MikeD
Newbie
Newbie
Posts: 30
Joined: Mon Jun 25, 2007 12:00 am

Re: ChartEditor: Available Series List in Function

Post by MikeD » Wed Feb 16, 2011 2:59 pm

I have tried a few things and still cannot get this to work. I simplified the processing just to see if I can get it to work. You should note that I create the dialog in a DLL that is initiated from within another DLL. Also, I use run time linking as the TChart processing is done in two different DLLs within my processing.

Just to see if I could get it to work, I created a form that contained just a DBChart and ChartEditer. I open this form in my processing and I cannot get it to work. I can add any series and display the data. If I then add a Function, there are no series available in the list to chose from (even though there is at lease one). This behavior is just like the test case I sent.

It appears there are some major issues associated with using the DBChart and ChartEditor in DLLs. I currently cannot get even the simplest situation to work in this type of situation. I will continue to look for a detour, but right now I have no solution to this problem.

Any information that you could provide would be greatly appreciated.

MikeD
Newbie
Newbie
Posts: 30
Joined: Mon Jun 25, 2007 12:00 am

Re: ChartEditor: Available Series List in Function

Post by MikeD » Wed Feb 16, 2011 10:30 pm

Just to get you up to date. I have found a detour this problem. The issue has to do when attaching one form to another. If the latter form has the DBChart and the parent one does not, it will fail. If the parent has a DBChart of any kind (even if hidden), it all works.

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

Re: ChartEditor: Available Series List in Function

Post by Yeray » Thu Feb 17, 2011 2:41 pm

Hi Mike,

I'd like to apologize for the delay with this. At the same time, I'm glad to see you've found a workaround.
I've opened a ticket into our defect list so it can be reviewed for future releases (TV52015395).
Thank you for reporting it and for your feedback.
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

rgsolutions
Newbie
Newbie
Posts: 46
Joined: Tue Jun 04, 2013 12:00 am

Re: ChartEditor: Available Series List in Function

Post by rgsolutions » Wed Mar 26, 2014 11:16 pm

I have to resurrect this problem as it is now occuring for me in XE4. When I was last posting this I was using XE2. Since then I was able to get it to run using XE4 and your XE4 Beta update. However, with your latest update for XE4, I am not able to get this to work.

To refresh the problem. I have a C++ application that is MDI based and creates TCharts on forms that are located in DLLs. In the DLL, the standard design form (SDF) contains a basic TDBChart and TChartEditor.

When I wish to design a report, I dynamically create a TDBChart internally and load it with all the report information. This chart is created with owner being the currently active MDI child. At this point, the chart is ready to be displayed. I then create the standard design form (SDF) passing in the internally created chart. In the constructor of standard design form (SDF), the processing substitutes the static TDBChart (on the SDF) with the passed in one, and then the form is made visible. The following is the code that is used to substitute charts:

Code: Select all

delete DBChart;
DBChart = report->db_chart;
DBChart->Parent = PanelDisplay;
DBChart->Visible = true;
ChartEditor->Chart = DBChart;
The PanelDisplay is the Parent of the old DBChart, and is a child of the Active MDI Child. Also, the ChartEditor is the static TChartEditor that is on the standard design form (SDF).

At this point my standard design form (SDF) is showing. In order for me to change the chart, I double click on the chart and it open the runtime ChartEditor. On the sample that I have included, I have two series on the chart, a Bar Series (Series1) and an Average Series (Series2). At this point I should see Series1 in the Available list, but I do not. (In the attached image, you can see part of Series1 in the display).

Up until this recent update, this all worked. I have tried every conceivable thing that I can think of and I cannot make this work. Have you got any ideas of what I am doing wrong?
Attachments
Empty Available List.png
Empty Available List.png (26.84 KiB) Viewed 22037 times

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

Re: ChartEditor: Available Series List in Function

Post by Yeray » Thu Mar 27, 2014 3:48 pm

Hello,

I've moved the ticket from the internal tracker to the public one:
http://bugs.teechart.net/show_bug.cgi?id=671
Feel free to add your mail account to the CC list so you can be automatically notified when an update arrives.
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

rgsolutions
Newbie
Newbie
Posts: 46
Joined: Tue Jun 04, 2013 12:00 am

Re: ChartEditor: Available Series List in Function

Post by rgsolutions » Fri Mar 28, 2014 5:27 pm

I have figured out what was going on and was able to fix it. You can close and delete this problem report if you wish.

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

Re: ChartEditor: Available Series List in Function

Post by Yeray » Mon Mar 31, 2014 7:13 am

Hello,
rgsolutions wrote:I have figured out what was going on and was able to fix it. You can close and delete this problem report if you wish.
Don't hesitate to let us know if you found any other clue that may help us or other customers to avoid this issue.
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

Post Reply