Page 1 of 1

Logarithmic Axes with TQRChart

Posted: Tue Nov 11, 2008 9:17 am
by 10549624
Hello,

i use TeeChart v8.02.10861 with C++Builder 6 and QuickReport 3.0.9. I have a problem with TQRChart: I can't print/preview a logarithmic axis in QRChart when i assign a normal Chart to TQRDBChart.

I have test with the following example:

Code: Select all

void __fastcall TForm1::Button1Click(TObject *Sender)
{
Chart1->LeftAxis->Logarithmic = true;
Chart1->LeftAxis->Automatic = false;
Chart1->LeftAxis->Maximum = 1000;
Chart1->LeftAxis->Minimum = 0;
Chart1->LeftAxis->Increment = 100;
Chart1->LeftAxis->Visible = true;
Chart1->View3D = false;

TLineSeries *Line = new TLineSeries(Chart1);
Line->ParentChart = Chart1;
Line->FillSampleValues(20);
Line->Visible = true;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Buuton2Click(TObject *Sender)
{
TQRChart 	*QRChart;
TQRDBChart *Chart;

QRChart = new TQRChart(this);

Chart = new TQRDBChart(QRChart);
Chart->Parent = QRChart;
Chart->Name = TeeGetUniqueName(Chart->Owner,"QRChart");

TQRBand *Band = (TQRBand*)QuickRep1->BandList->Items[0];

QRChart->Parent = Band;

QRChart->Top = Chart1->Top;
QRChart->Left = Chart1->Left;
QRChart->Width = Chart1->Width;
QRChart->Height = Chart1->Height;

QRChart->Chart->FreeAllSeries();
QRChart->Chart->Assign(Chart1);

for (int t=0; t<Chart1->SeriesCount(); t++)
  CloneChartSeries(Chart1->Series[t])->ParentChart = QRChart->Chart;

QuickRep1->Preview();
}
On the Form are a TChart (Chart1), a QuickReport (QuickRep1) and two Buttons.

The Preview shows a normal scaled axis and when I print the QuickReport there is also a normal scaled axis and no logarithmic scaled axis.

I used the same example before with TeeChart 4 Standard and it works properly. What can I do to get the logarithmic scaled axis on the preview/printing?

Thanks and regards

Moe

Posted: Tue Nov 11, 2008 9:34 am
by narcis
Hi Moe,

Could you please check if v8.04, which is latest version available at the client area, solves the problem at your end?

Thanks in advance.

Posted: Tue Nov 11, 2008 9:49 am
by 10549624
Hello,

there is no difference with TeeChart v8.04.11395.

Thanks and regards,

Moe

Posted: Tue Nov 11, 2008 10:07 am
by narcis
Hi Moe,

Thanks for the information.

I've been able to reproduce the issue here and it seems a bug to me. I've added it (TV52013559) to the defect list to be fixed for next releases.

Posted: Tue Nov 11, 2008 10:13 am
by narcis
Hi Moe,

As an update, I found that adding line below to your code solves the problem

Code: Select all

  QRChart->Chart->Axes->Left->Logarithmic=Chart1->Axes->Left->Logarithmic;
For example:

Code: Select all

  QRChart->Chart->FreeAllSeries();
  QRChart->Chart->Assign(Chart1);
  QRChart->Chart->Axes->Left->Logarithmic=Chart1->Axes->Left->Logarithmic;

  for (int t=0; t<Chart1->SeriesCount(); t++)
    CloneChartSeries(Chart1->Series[t])->ParentChart = QRChart->Chart;

  QuickRep1->Preview();
Hope this helps!

Posted: Tue Nov 11, 2008 10:23 am
by 10549624
Thanks, this works fine.

By my tests with the debugger I checked the value from QRChart->Chart->LeftAxis->Logarithmic after the assign and there it was true also. So I thought the value was assigned correctly.

Thanks and regards,

Moe