TQRChart BottomAxis.LabelsFont

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Al1
Newbie
Newbie
Posts: 14
Joined: Tue Jan 20, 2009 12:00 am

TQRChart BottomAxis.LabelsFont

Post by Al1 » Tue May 19, 2009 10:42 am

Hey,

Yet another Unicode issue...
RAD Studio 2009
TeeChart Pro 8.04
QuickReport Pro 5.04.2

As I need to export graphs as PDF files and it is not supported by TeeChart for Delphi 2009, I have tried to use QuickReport (with Gnostice Technologies). In a TQuickRep I have add a TQRChart for which I have specified the chart to be exported (QRChart1.SetChart(Chart1)). Chart1 contains a TBarSeries with Unicode labels. They are correctly displayed in Chart1 (assigning Chart1.BottomAxis.LabelsFont to 'Arial Unicode MS') but not in QRChart1. It seems QRChart1.BottomAxis.LabelsFont is enforced to 'Arial'!
I have uploaded a file QuickReport.zip which contains 2 QRP files showing the export with TQRChart or TQRGrImage (from TMetaFile). As TQRChart is better (especially for TPieSeries), could you solve this?

Best regards,

Alain

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

Post by Yeray » Tue May 19, 2009 3:07 pm

Hi Alain,

If I understand well, this code should reproduce the issue, isn't it?
It seems to work fine here. Please, could you send us a simple example project we can run "as-is" to reproduce the problem here?
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.

Code: Select all

uses series;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.AddSeries(TBarSeries.Create(self));
  Chart1[0].FillSampleValues(5);
  Chart1[0].Labels[2] := '活体';

  Chart1.Axes.Bottom.LabelsFont.Name := 'Arial Unicode MS';
  QRChart1.SetChart(Chart1);
end;
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

Al1
Newbie
Newbie
Posts: 14
Joined: Tue Jan 20, 2009 12:00 am

Post by Al1 » Tue May 19, 2009 3:15 pm

I sent you a project (Project1.zip) showing this problem.
The Form1 contains a Unicode chart with a TBarSeries. The Clone button opens Form2 copying the TBarSeries to another chart using CloneChartSeries. Everything is OK!
The Form2 has also a Clone button which opens Form3 assigning the TChart to a TQRChart using SetChart. LabelsFont properties are ignored!
LeftAxis is not fsBold and BottomAxis is not fsItalic. I think that 'Arial' is used instead of 'Arial Unicode MS'. That is why the Chinese characters are replaced by white squares...

Al1
Newbie
Newbie
Posts: 14
Joined: Tue Jan 20, 2009 12:00 am

Post by Al1 » Tue May 19, 2009 4:38 pm

You're right, this code works fine:

Code: Select all

  Chart2 := TChart.Create(Self);
  try
    Chart2.Align := alClient;
    Chart2.Color := clWhite;
    Chart2.BackWall.Color := clWhite;
    Chart2.BottomWall.Color := clGray;
    Chart2.Title.Font.Height := -21;
    Chart2.Title.Font.Name := 'Arial Unicode MS';
    Chart2.Title.Text.Clear;
    Chart2.Title.Text.Add('中文');
    Chart2.AddSeries(TBarSeries.Create(Self));
    Chart2[0].ColorEachPoint := True;
    Chart2[0].FillSampleValues(9);
    Chart2.Axes.Left.LabelsFont.Height := -13;
    Chart2.Axes.Left.LabelsFont.Name := 'Arial Unicode MS';
    Chart2.Axes.Left.LabelsFont.Style := [fsBold];
    Chart2.Axes.Bottom.LabelsFont.Height := -13;
    Chart2.Axes.Bottom.LabelsFont.Name := 'Arial Unicode MS';
    Chart2.Axes.Bottom.LabelsFont.Style := [fsItalic];
    Chart2.Axes.Bottom.LabelStyle := talText;
    Chart2.Legend.Font.Name := 'Arial Unicode MS';
    Chart2[0].Marks.Font.Name:= 'Arial Unicode MS';
    Chart2[0].Labels[0] := 'Gerste';
    Chart2[0].Labels[1] := 'Barley';
    Chart2[0].Labels[2] := 'Cevada';
    Chart2[0].Labels[3] := 'Orge';
    Chart2[0].Labels[4] := 'Árpa';
    Chart2[0].Labels[5] := 'Orzo';
    Chart2[0].Labels[6] := 'Jęczmień';
    Chart2[0].Labels[7] := 'Korn';
    Chart2[0].Labels[8] := '大麦';
    Form3.QRChart1.SetChart(Chart2);
    Form3.ShowModal;
  finally
    Chart2.Free;
  end;
Another solution is to configure (at design time) the TQRChart and clone the TBarSeries:

Code: Select all

//  Form3.QRChart1.SetChart(Chart1);
  CloneChartSeries(Chart1[0]).ParentChart := Form3.QRChart1.Chart;
SetChart does not function properly!

Thank you very much, this can be a way to by-pass this issue.

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

Post by Yeray » Wed May 20, 2009 8:51 am

Hi Alain,

I'm happy to see that you've found a workaround but anyway I've added it to the wish list to be fixed in future releases (TV52014163).
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

Al1
Newbie
Newbie
Posts: 14
Joined: Tue Jan 20, 2009 12:00 am

Post by Al1 » Wed May 20, 2009 9:52 am

Thank you Yeray,
It will be better when would have fixed it, because it needs a lot of more code!
Best regards,
Alain

Post Reply