Page 1 of 1

TFactsTheme observation

Posted: Sat Sep 10, 2005 6:53 pm
by 9343038
When I apply TFactsTheme I notice that line charts disappear. Looking at the code for Apply, I see that this is happening but wonder why this is done. Is this a bug or is this done for a reason I do not understand??

--Paul

Code: Select all

    for t:=0 to SeriesCount-1 do
    with Series[t] do
    begin
      Pen.Visible:=False;

Posted: Mon Sep 12, 2005 8:28 am
by narcis
Hi Paul,

I'm not able to reproduce this problem here. Would you be so kind to tell us the specific steps or send us an example we can run "as-is" to reproduce the problem here?

You can post your files at [url]news://www.steema.net/steema.public.attachments[/url] newsgroup.

Thanks in advance.

Posted: Mon Sep 12, 2005 8:58 pm
by 9343038
Narcis,

Pointing to the source code it looked obvious to me that this was happening, but seeing is believeing:

--Paul

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
var
   LS: TLineSeries;
begin
Chart1.View3D := false;
LS := TLineSeries.Create(Chart1);
LS.Pen.Width := 2;
LS.FillSampleValues(6);
Chart1.AddSeries(LS);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
ApplyChartTheme(TFactsTheme, Chart1);
end;

Posted: Tue Sep 13, 2005 8:52 am
by narcis
Hi Paul,

Sorry but I read your message too quick and didn't realise you were speaking about source code. I've been able to reproduce the problem and we already have a fix for it.

If you want I can send you our latest sources (to your contact e-mail address) or I can also suggest you a quick and "dirty" solution, while you wait for next maintenance release, which would be adding an if statement to the TFactsTheme.Apply were the Pen.Visible:=false happens:

Code: Select all

    for t:=0 to SeriesCount-1 do
    begin
      if (Series[t] is TBarSeries) then	 
      	Pen.Visible:=TSeriesAccess(Series[t]).IMandatoryPen;
However, this is not much recomandable as introduces a dependency to the Series unit.