I can not remove the shadow (marks)

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Pense
Newbie
Newbie
Posts: 3
Joined: Fri Apr 01, 2011 12:00 am

I can not remove the shadow (marks)

Post by Pense » Mon Jun 13, 2011 5:49 pm

The shadow of the marks does not work on DBChart (TeeChart Standard v2011 VCL - Delphi 7)

At runtime:

/ / does not work
MyDBChart.Series [0]. Marks.Shadow.Visible: = False;

/ / does not work
MyDBChart.Series [0]. Marks.Shadow.Transparency: = 100;

/ / This works fine
MyDBChart.Series [0]. Marks.FontSeriesColor: = True;

How do I remove the shadow?

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

Re: I can not remove the shadow (marks)

Post by Yeray » Wed Jun 15, 2011 9:18 am

Hello Pense,

I'm not able to reproduce the problem here. Are you using the latest version available (v2011.03.30407)?
The three lines you mentioned seem to work as expected for me here with a TPointSeries and a TBarSeries.
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

Pense
Newbie
Newbie
Posts: 3
Joined: Fri Apr 01, 2011 12:00 am

Re: I can not remove the shadow (marks)

Post by Pense » Thu Jun 16, 2011 4:18 am

Oi Yeray,

Obrigado por responder ao meu post. O cenário do meu problema é o seguinte:

No formulário eu tenho um Button e um DBChart apenas, além de 3 procedimentos. O problema todo foi provocado por um pequeno algoritmo no evento OnShow do formulário que oculta todas as Marks cujo valor seja igual a zero (YValue = 0).

procedure TForm1.FormCreate(Sender: TObject);
begin
(DBChart1.AddSeries(TBarSeries) as TBarSeries).FillSampleValues();
end;

procedure TForm1.FormShow(Sender: TObject);
var i: integer;
begin
// exemplo
DBChart1.Series[0].YValue[1]:= 0;

// após executar este algoritmo, o evento do botão deixa de funcionar
// Exit;
with DBChart1.Series[0] do
for i:= 0 to (Count-1) do
Marks.Visible:= YValue>0;
end;

// Evento atribuído ao botão (TButton) que está no Formulário
procedure TForm1.BtnShadowClick(Sender: TObject);
begin
with DBChart1.Series[0].Marks.Shadow do
Visible:= not Visible;
end;

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: I can not remove the shadow (marks)

Post by Narcís » Thu Jun 16, 2011 8:51 am

Hi Pense,

I could reproduce the issue here now and added it (TV52015618) to the defect list to be investigated. As an alternative, there's a much easier way to hide marks which is using the OnGetMarkText event as shown here:

Code: Select all

uses Series;

procedure TForm1.FormCreate(Sender: TObject);
begin
  DBChart1.AddSeries(TBarSeries.Create(Self)).FillSampleValues;
  DBChart1[0].OnGetMarkText := Series1GetMarkText;
end;

procedure TForm1.FormShow(Sender: TObject);
//var i: integer;
begin
  DBChart1[0].YValue[1]:= 0;

  //Hidding Marks with Y = 0 in loop below makes marks shadow not responsive
  //Exit;
  {with DBChart1[0] do
    for i:= 0 to (Count-1) do
      Marks[i].Visible:= YValue[i]>0;
  }
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  with DBChart1[0].Marks.Shadow do
    Visible:= not Visible;
end;

procedure TForm1.Series1GetMarkText(Sender: TChartSeries;
  ValueIndex: Integer; var MarkText: String);
begin
  if MarkText=IntToStr(0) then MarkText:='';
end;
Doing so marks shadow visibility can be toggled.

Hope this helps!
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Pense
Newbie
Newbie
Posts: 3
Joined: Fri Apr 01, 2011 12:00 am

Re: I can not remove the shadow (marks)

Post by Pense » Thu Jun 16, 2011 1:46 pm

Oi Narcís,

Sim, está resolvido. Muito obrigado!

Ficou assim:

procedure TForm1.Series1GetMarkText(Sender: TChartSeries;
ValueIndex: Integer; var MarkText: String);
begin
if Sender.YValue[ValueIndex] = 0 then
MarkText:='';
end;

Post Reply