Page 1 of 1

ColorLineTool not displayed properly

Posted: Tue Oct 08, 2013 10:51 pm
by 16465954
I'm using XE4 with TeeChartPro 2013 Build 2013.08.130521

I've got a form that has 6 different TeeCharts in a TcxScrollBox (DevEx component). When the form is displayed you can initially see about 2.5 charts and the user has to scroll down to see the others. Each chart as between 1 to 5 ColorLineTools added. All charts are bar graphs. The charts are not data-aware although the values that are loaded at run-time come from a database. The form has a button that will run a QuickReport v5 report that will print the charts along with some other data. The charts on the report are all loaded from the charts on the form using the following code.

Code: Select all

QRChart2.Width := ImpRefDetailBand.Width;
QRChart2.Height := frmTR.chtImpRef.Height;
QRChart2.SetChart(frmTR.chtImpRef);
TBarSeries(QRChart2.Chart[0]).AutoBarSize := True;
QRChart2.Chart.Color := clWhite;
QRChart2.Chart.BottomAxis.Automatic := True;
QRChart2.Chart.MaxPointsPerPage := 25;
QRChart2.Chart.ScaleLastPage := False;
Everything works perfectly except for the ColorLineTools on the printed charts. I've found that if the chart has NOT been scrolled into view in the TcxScrollBox before the report is printed, then the ColorLineTools will be printed way above the top of the chart (above the y axis scale). If I scroll to the bottom of the TcxScrollBox and then back to the top (so that all charts were visible at some point) then the ColorLineTools on the report will all be printed correctly. I've tried everything I can think of but can't figure out what is causing this to happen. Any ideas?

Thanks
Scott

Re: ColorLineTool not displayed properly

Posted: Thu Oct 10, 2013 3:34 pm
by yeray
Hi,

I'm not sure if the way you organize the charts in the report could be important here.
Could you please try to arrange a simple example project we can run as-is to reproduce the problem here?
Thanks in advance.

Re: ColorLineTool not displayed properly

Posted: Mon Oct 21, 2013 9:23 pm
by 16465954
I have attached a sample application to illustrate the problem. The sample consists of 2 forms. Once is the main form with 2 TCharts and the other is a QuickReport form with 2 TQRCharts.

When you first run the program you will see one chart with 5 ColorLineTool lines visible. There is a second chart off screen below the first chart that has 4 ColorLineTool lines. To make that chart visible you will need to make the window taller but DO NOT do that yet. Click the Go button to open a QuickReport preview of the 2 charts. The two charts correspond to the two charts on the main form. You'll see that the ColorLineTool lines are correct on the top chart but the lines for the bottom chart are all displayed at the top of the chart above the bar graph. This is the problem.

If you now close the preview and then resize the main form so that any portion of the second chart is visible and then click the Go button again, you'll see the second chart on the preview now shows the ColorLineTool lines correctly.

FYI. The attached file does not contain an executable sample (just project source files). The forum upload would not allow me to attach a file larger than 512Kb. If you need a sample EXE let me know where I can email it.

Scott Slater

Re: ColorLineTool not displayed properly

Posted: Fri Oct 25, 2013 8:00 am
by yeray
Hi,

Excuse us for the delayed reply. We will prepare an environment like yours to do the tests as soon as possible.

Re: ColorLineTool not displayed properly

Posted: Thu Oct 31, 2013 9:03 pm
by 16465954
Just wondering if there was any update on this issue. I can still send you a working sample .exe if you'd like. I can't attach it here since it only allows 512K size. I can email it to you if you'd like.

Thanks
Scott Slater

Re: ColorLineTool not displayed properly

Posted: Mon Nov 04, 2013 9:14 am
by yeray
Hi Scott,

Excuse us for the delayed reply.
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.

Re: ColorLineTool not displayed properly

Posted: Tue Nov 05, 2013 10:25 pm
by 16465954
Yeray,

The upload page gives a configuration error and I cannot seem to connect to the news server you specified. I use other news servers all the time but I can't get yours to work. Is the address right? Is there an email address I can send the attachment to?

Scott

Re: ColorLineTool not displayed properly

Posted: Wed Nov 06, 2013 9:39 am
by yeray
Hi Scott,

Sorry, you can send your attachments to "info at steema dot com", referencing this thread.
The upload page seems to work fine for me here though.

Re: ColorLineTool not displayed properly

Posted: Thu Nov 07, 2013 6:17 pm
by 16465954
I'll send you an email shortly. Thanks!

Here is the error I get when I try to use the upload page. I'm using Chrome browser.

Re: ColorLineTool not displayed properly

Posted: Fri Nov 08, 2013 9:27 am
by narcis
Hi Scott,

Thanks for the exe. The problem looks like a refresh problem to me, that the TColorLineTool instances need the chart to be painted so that they can be positioned correctly. I'd try calling TChart.Draw() before positioning the ColorLines so that all chart objects have been painted and they have valid property values. You could also try calling Draw() at TQRChart level or maybe before assigning a TChart to a TQRChart, something like this:

Code: Select all

   Form2.chtImpedance.Draw();
   QRChart1.SetChart(Form2.chtImpedance);
If this doesn't help don't hesitate to let us know.

Re: ColorLineTool not displayed properly

Posted: Fri Nov 08, 2013 11:41 am
by narcis
Hi Scott,
sevenout wrote:Here is the error I get when I try to use the upload page.
Thanks for your feedback. The upload page has been fixed now.

Re: ColorLineTool not displayed properly

Posted: Fri Nov 08, 2013 9:48 pm
by 16465954
I'd try calling TChart.Draw() before positioning the ColorLines so that all chart objects have been painted and they have valid property values.
That seems to do the trick.

Thanks!
Scott