I just upgraded to TChart 2012 for RAD Studio 2009. The problem is the chart's left/right/bottom axis title and labels now display in a font that is not Arial font. The text is drawn with a very thin line (you can clearly see individual pixels) - thus hard to read.
At run time, my debug environment says the axis LabelsFont is Arial. Version 8 that came with RAD Studio displays in Arial as expected.
To see at design time:
Create a new form, add a standard TChart. Bring up the chart editor and add a FastLineSeries. Edit the left axis maximum or minimum so one of them starts with the number 900. Change the chart background from gray to white so you can see the text clearly.
Look at the 9 in axis label "900" (font sizes 8 and 9) - it is not Arial. Compare to a 9 in Windows Notepad formated as Arial.
Strangely, if you turn on Bold for the font, the "900" looks like Arial!
Please fix.
Thanks.
axis title/labels not using Arial font
Re: axis title/labels not using Arial font
Hi,
Try setting the labels font quality to fqDefault:
Try setting the labels font quality to fqDefault:
Code: Select all
uses Series, TeCanvas;
procedure TForm1.FormCreate(Sender: TObject);
begin
Chart1.AddSeries(TFastLineSeries);
Chart1.Axes.Left.SetMinMax(0, 900);
Chart1.Gradient.Visible:=false;
Chart1.Color:=clWhite;
Chart1.Axes.Left.LabelsFont.Name:='Arial';
Chart1.Axes.Left.LabelsFont.Size:=15;
Chart1.Axes.Left.LabelsFont.Quality:=fqDefault;
Color:=clWhite;
end;
procedure TForm1.FormPaint(Sender: TObject);
begin
Canvas.Font.Name:='Arial';
Canvas.Font.Size:=15;
Canvas.TextOut(Chart1.Left+20, Chart1.Top-20, '900');
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: axis title/labels not using Arial font
Yeray,
Setting font.Quality to fqNormal for all titles and labels fixes text drawing that TChart does. Great.
But the Arial text drawing I do in ChartAfterDraw event to the TChart canvas still looks bad. Since the TChart canvas.font does not does not have the Quality property, what do I set?
Thanks.
Setting font.Quality to fqNormal for all titles and labels fixes text drawing that TChart does. Great.
But the Arial text drawing I do in ChartAfterDraw event to the TChart canvas still looks bad. Since the TChart canvas.font does not does not have the Quality property, what do I set?
Thanks.
Re: axis title/labels not using Arial font
my typo
I set the Quality to fqDefault as you suggested, not fqNormal as in my previous post.
I set the Quality to fqDefault as you suggested, not fqNormal as in my previous post.
Re: axis title/labels not using Arial font
Hi,
The easiest will probably be using GDI+:
The easiest will probably be using GDI+:
Code: Select all
g:=TGDIPlusCanvas.Create;
Chart1.Canvas:=g;
g.AntiAliasText:=gpfDefault;
//g.AntiAlias:=false;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |