Formatting bug with a strange fix

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
EdDressel
Newbie
Newbie
Posts: 35
Joined: Mon Nov 25, 2019 12:00 am

Formatting bug with a strange fix

Post by EdDressel » Thu Dec 17, 2020 11:17 pm

We were getting a formatting bug with a series in our application. We are using the .LeftAxis.LabelsFormat.TextFormat := ttfHtml setting and the left axis appeared correctly until the mouse hovered over it--then it appeared with the html formatting. Here are two images, showing what was happening:

Image

I tried creating a demo of it and could not, evening copying the exact objects and code.

I gave it to another programmer and he found a fix: a design-time there is a chart bar series in the chart that he removed and re-rand the program and it now displays correctly. The Chart.FreeAllSeries method is called in code before creating a new series--so I don't understand what is happening.

I only put this here as a bookmark--there is no action needed. Just as an FYI, and in case someone else sees something like this.

Ed Dressel
Ed Dressel
President
RetireReady Solutions

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

Re: Formatting bug with a strange fix

Post by Yeray » Mon Dec 21, 2020 11:52 am

Hello,

I've been trying to reproduce the problem in a simple project but I had the same luck than you.
Anyway I'm posting here the code in case it needs to be revised in the future:

Code: Select all

var i: Integer;
begin
  AddSeries(THorizBarSeries);
  Chart1[0].Visible:=False;
  AddSeries(THorizBarSeries);

  with Chart1[1] do
  begin
    Marks.Hide;
    for i:=0 to Count-1 do
      Labels[i]:='<b>Point ' + IntToStr(i)+'</b>' + sLineBreak + ValueMarkText[i];
  end;

  Chart1.Axes.Left.LabelsFormat.TextFormat:=ttfHtml;
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

Post Reply