Strange behaviour of a TeeChart in a Tabcontrol
Strange behaviour of a TeeChart in a Tabcontrol
Hi all!
Simply create a tabcontrol and two tabpages. Place on each page a Tchart and create some data. After starting the form, ask for the .Axes.Bottom.IAxisSize of the second chart. It's zero! In a different thread I've dicussed this behaviour and asked for some information how to bypass. I don't know how many additional properties of the Chart show this behaviour? (question to Steema?)
The same behaviour I encountered while making a picture of the second chart using the streaming method. The stream fails as long as the tabpage is clicked and the second chart is shown. Same like described above.
How to fix this behaviour (except for rotation through the tappages before streaming/printing/asking for values)?
The main problem seems to be: drawing on a chart in the background (or on a tabpage in the background).
My question: can Steema fix this behaviour? Very Urgent!
Thanks in advance
Alex
Simply create a tabcontrol and two tabpages. Place on each page a Tchart and create some data. After starting the form, ask for the .Axes.Bottom.IAxisSize of the second chart. It's zero! In a different thread I've dicussed this behaviour and asked for some information how to bypass. I don't know how many additional properties of the Chart show this behaviour? (question to Steema?)
The same behaviour I encountered while making a picture of the second chart using the streaming method. The stream fails as long as the tabpage is clicked and the second chart is shown. Same like described above.
How to fix this behaviour (except for rotation through the tappages before streaming/printing/asking for values)?
The main problem seems to be: drawing on a chart in the background (or on a tabpage in the background).
My question: can Steema fix this behaviour? Very Urgent!
Thanks in advance
Alex
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Alex,
I've been able to reproduce the behaviour you report. This happens because the value is not updated until the chart is drawn. If you read it on AfterDraw event it will be correct.Simply create a tabcontrol and two tabpages. Place on each page a Tchart and create some data. After starting the form, ask for the .Axes.Bottom.IAxisSize of the second chart. It's zero! In a different thread I've dicussed this behaviour and asked for some information how to bypass. I don't know how many additional properties of the Chart show this behaviour? (question to Steema?)
Could you please post an example we can run "as-is" in the newsgroups to reproduce the problem here?The same behaviour I encountered while making a picture of the second chart using the streaming method. The stream fails as long as the tabpage is clicked and the second chart is shown. Same like described above.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Hi Narcis,
that's the problem. Is there a way to manually force a "Draw" without displaying the chart by clicking the tabpage? (e.g. TChart1.DrawSeries ???).
The problem is, I cannot circle through all charts of the whole app and display... (after placing some series to the charts).
I've posted an example project using the tabcontrol and the streaming... Please have a look, I think it's the same problem that there is no "Draw" made even though something on the Chart has changed.
Maybe the "Draw" can be forced? (in the background?) I think then all this problems will disappear.
Thanks in advance!
Best regards
Alex
that's the problem. Is there a way to manually force a "Draw" without displaying the chart by clicking the tabpage? (e.g. TChart1.DrawSeries ???).
The problem is, I cannot circle through all charts of the whole app and display... (after placing some series to the charts).
I've posted an example project using the tabcontrol and the streaming... Please have a look, I think it's the same problem that there is no "Draw" made even though something on the Chart has changed.
Maybe the "Draw" can be forced? (in the background?) I think then all this problems will disappear.
Thanks in advance!
Best regards
Alex
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hi Alex,
Thank you for posting an example.
Looking at your code, I can't see why you can't use the techniques outlined in the TeeChart Pro .NET Tutorials under Tutorial 14 - Printing Charts -> Extended Printing methods.
If you would rather work with Print Documents, please see:
http://tinyurl.com/49kes
Thank you for posting an example.
Looking at your code, I can't see why you can't use the techniques outlined in the TeeChart Pro .NET Tutorials under Tutorial 14 - Printing Charts -> Extended Printing methods.
If you would rather work with Print Documents, please see:
http://tinyurl.com/49kes
Thank you!
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Hi Chris,
thanks for your mention. Narcis asked for a short example project, which I have posted. Printing multiple charts on multiple pages is only possible via streaming to an image. Please see the past postings and topics concerning this problem (Pep, Narcis).
Thanks for your hint, it's not useable.
A) Why the example project will not work?
B) How to force an update to a chart without displaying it on top?
Other trivial solutions, e.g. "look in the tutorial" are not requested.
Thanks
Alex
thanks for your mention. Narcis asked for a short example project, which I have posted. Printing multiple charts on multiple pages is only possible via streaming to an image. Please see the past postings and topics concerning this problem (Pep, Narcis).
Thanks for your hint, it's not useable.
A) Why the example project will not work?
B) How to force an update to a chart without displaying it on top?
Other trivial solutions, e.g. "look in the tutorial" are not requested.
Thanks
Alex
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hi Alex,
Yes, the one I was referring to when I said "Looking at your code" in my last post.thanks for your mention. Narcis asked for a short example project, which I have posted.
What does this mean, exactly? You can print multiple charts to a printer without streaming them individually to bitmaps using the techniques outlined in the Tutorials I mentioned. You can also print charts to PrintDocuments which you can then print individually or multiply, as you wish.Printing multiple charts on multiple pages is only possible via streaming to an image.
Have you looked in the Tutorials as I suggested? What is it, exactly, that you are trying to achieve? Four charts on one piece of printed paper? Six printed charts, three on each of two pieces of paper? Until you give us a clear idea of what you want to achieve I'm afraid we are not going to either be able to help you or be able to make the relevant changes, if necessary, to the source code.Other trivial solutions, e.g. "look in the tutorial" are not requested.
Thank you!
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hi Alex,
One possible solution to your problem maybe the following:
One possible solution to your problem maybe the following:
Code: Select all
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim printdocument1 As Printing.PrintDocument
'using trivial techniques readily available in the tutorials and FAQ:
TChart1.Printer.BeginPrint()
TChart1.Printer.Print(TChart2.Chart, New Rectangle(10, 300, TChart2.Width, TChart2.Height))
TChart1.Printer.Print(New Rectangle(10, 10, TChart1.Width, TChart1.Height))
printdocument1 = TChart1.Printer.PrintDocument
Dim test As New PrintPreviewDialog
With test
.Document = printdocument1
.ShowDialog()
End With
End Sub
Thank you!
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Hi Chris,
By the way, thanks to Pep and Narcis for their excellent help in the past.
Best regards
Alex
Please have a look into the topic "Printing AX-V7 in .NET using the PrintDocument???" in the Ax-Forum. There is the history...Yes, the one I was referring to when I said "Looking at your code" in my last post.
Maybe I am to stupid to recognize how to do? How to make a manual page break using the Tchart.Printer? How to add custom graphics to the print document related to the current page? Please refer to Pep and Narcis about the solution via streaming... (Original idea: use standard .NET printing methods -> stream the chart to an image -> place to the print document related the page using e.hasmorepages). Maybe you're now the right person to solve this problems?What does this mean, exactly? You can print multiple charts to a printer without streaming them individually to bitmaps using the techniques outlined in the Tutorials I mentioned.
Yes, something in this way. Additional the Charts are placed in a tabcontrol. I won't display all charts before printing. (refer to IAxis problem and streaming problem, thats the reason why this thread exists. Not only for fun. )Six printed charts, three on each of two pieces of paper?
I think that's the moment where I should ask you, if I maybe have misunderstood your posting? That's right, or isn't it? Of course, in the way you write I have to think you have a little problem with me or my questions? I would propose to ask your collegues or read my postings. I don't know what you want to hear? Precise descriptions on the problems were done in the past.Until you give us a clear idea of what you want to achieve I'm afraid we are not going to either be able to help you or be able to make the relevant changes, if necessary, to the source code.
By the way, thanks to Pep and Narcis for their excellent help in the past.
Best regards
Alex
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hi Alex,
How about starting from the code example I posted a few minutes ago, i.e.
Would you be so kind as to tell me if this solves the problem of printing two teecharts, one of which hidden in a tabpage, to a printdocument and then displaying this printdocument in a standard PrintPreviewDialog? This is what I see as the functionality of the code you posted to the attachments newsgroup.
What else do you need to do? If you need to add non-teechart information to the printdocument then you can further use the techniques outlined in the tutorials. You should be able to add page breaks using native .net methodologies.
I really am trying to help you solve your issues here and I'm sorry for any misunderstandings that may have arisen during our communication so far.
How about starting from the code example I posted a few minutes ago, i.e.
Code: Select all
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim printdocument1 As Printing.PrintDocument
TChart1.Printer.BeginPrint()
TChart1.Printer.Print(TChart2.Chart, New Rectangle(10, 300, TChart2.Width, TChart2.Height))
TChart1.Printer.Print(New Rectangle(10, 10, TChart1.Width, TChart1.Height))
printdocument1 = TChart1.Printer.PrintDocument
Dim test As New PrintPreviewDialog
With test
.Document = printdocument1
.ShowDialog()
End With
End Sub
What else do you need to do? If you need to add non-teechart information to the printdocument then you can further use the techniques outlined in the tutorials. You should be able to add page breaks using native .net methodologies.
I really am trying to help you solve your issues here and I'm sorry for any misunderstandings that may have arisen during our communication so far.
Thank you!
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Hi Chris,
thanks for the code. Ok, lets start using this code.
Two questions:
- How can I add a page break between chart1 and chart2?
- How can I change the aspect ratio of both charts related to their IAxisSize? (Reason: manually isometric scaling of the charts, that means I ask for the pixel size of the chart and adjust my bottom/left axis borders to get isometric scaling). If the TChart is placed in a tabcontrol (background) the IAxisSize is not available until the chart is displayed.
Thanks.
Alex
thanks for the code. Ok, lets start using this code.
Two questions:
- How can I add a page break between chart1 and chart2?
- How can I change the aspect ratio of both charts related to their IAxisSize? (Reason: manually isometric scaling of the charts, that means I ask for the pixel size of the chart and adjust my bottom/left axis borders to get isometric scaling). If the TChart is placed in a tabcontrol (background) the IAxisSize is not available until the chart is displayed.
Thanks.
Alex
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hi Alex,
I'm not sure entirely what you mean here .. do you mean that you'd like the charts to appear as two separate pages in the print preview? This being so then my best suggestion is to print the charts as two separate printdocuments and then somehow add them to the print preview as two separate pages.- How can I add a page break between chart1 and chart2?
It's not necessary .. I've just posted an example of how to make a chart's axis isometric, in the context of your example, to the steema.public.attachments newsgroup.- How can I change the aspect ratio of both charts related to their IAxisSize? (Reason: manually isometric scaling of the charts, that means I ask for the pixel size of the chart and adjust my bottom/left axis borders to get isometric scaling). If the TChart is placed in a tabcontrol (background) the IAxisSize is not available until the chart is displayed.
Thank you!
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/