BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TeeChart individual marks

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Reporting-Charting
View previous topic :: View next topic  
Author Message
Philip E. Jurgenson
Guest





PostPosted: Mon Mar 26, 2007 7:43 pm    Post subject: TeeChart individual marks Reply with quote



D2006
TeeChart Standard CodeGear Edition

I've been trying to figure out how to display a single mark for a value
in a bar chart when the mouse moves over a bar. No problem figuring out
which series is referenced, and it's not a problem to figure out which
individual mark is represented by the bar. However, despite the fact
that each mark (TMarksItem) has a "Visible" property, it doesn't seem
to work in a way that's _implied_ by the help file.

I've tried setting the series' Marks.Visible := True and then setting
each individual mark (Marks.Item[xx].Visible := False) to not visible -
that doesn't seem to work. I've even gone so far as to change the font
color to match the background, then on the MouseEnter event change the
font color to something visible, and changing it again in the
MouseLeave event. This sort of works, but not very well.

Has anybody tried to do this sort of thing? It's for an application
that only I use, and isn't important enough to spend the money to
upgrade to a version with source. Still, I'd like to know whether this
is possible or not - it'll bug me until I know one way or another! :-)

Any suggestions appreciated - Thanks!

Phil

--
Back to top
David Berneda
Guest





PostPosted: Mon Mar 26, 2007 7:44 pm    Post subject: Re: TeeChart individual marks Reply with quote



Hi Philip
Instead of using the MarksItem Visible property you might want to try using
the Series1 "OnGetMarkText" event, and setting the string parameter to empty
string for the marks you want to hide.

See the code below, I think it does what you need.

You might also want to submit your question at our support forms or public
newsgroups so we can verify if the Marksitem Visible property is working
correctly or not.

http://www.steema.com/products/support/support_agreements.html

regards
david
www.teechart.com


var
Current : Integer=-1;

procedure TForm1.Chart1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
var tmp : Integer;
begin
tmp:=Series1.Clicked(x,y);

if tmp<>Current then
begin
Current:=tmp;
Series1.Repaint;
end;
end;

procedure TForm1.Series1GetMarkText(Sender: TChartSeries;
ValueIndex: Integer; var MarkText: String);
begin
if ValueIndex <> Current then
MarkText:='';
end;


"Philip E. Jurgenson" <pejurgen (AT) hickorytech (DOT) net> wrote in message
news:4607cdfa (AT) newsgroups (DOT) borland.com...
Quote:
D2006
TeeChart Standard CodeGear Edition

I've been trying to figure out how to display a single mark for a value
in a bar chart when the mouse moves over a bar. No problem figuring out
which series is referenced, and it's not a problem to figure out which
individual mark is represented by the bar. However, despite the fact
that each mark (TMarksItem) has a "Visible" property, it doesn't seem
to work in a way that's _implied_ by the help file.

I've tried setting the series' Marks.Visible := True and then setting
each individual mark (Marks.Item[xx].Visible := False) to not visible -
that doesn't seem to work. I've even gone so far as to change the font
color to match the background, then on the MouseEnter event change the
font color to something visible, and changing it again in the
MouseLeave event. This sort of works, but not very well.

Has anybody tried to do this sort of thing? It's for an application
that only I use, and isn't important enough to spend the money to
upgrade to a version with source. Still, I'd like to know whether this
is possible or not - it'll bug me until I know one way or another! :-)

Any suggestions appreciated - Thanks!

Phil

--
Back to top
Philip E. Jurgenson
Guest





PostPosted: Mon Mar 26, 2007 11:47 pm    Post subject: Re: TeeChart individual marks Reply with quote



David Berneda wrote:

Quote:
Hi Philip
Instead of using the MarksItem Visible property you might want to try
using the Series1 "OnGetMarkText" event, and setting the string
parameter to empty string for the marks you want to hide.

See the code below, I think it does what you need.

You might also want to submit your question at our support forms or
public newsgroups so we can verify if the Marksitem Visible property
is working correctly or not.

http://www.steema.com/products/support/support_agreements.html

regards
david
www.teechart.com


var
Current : Integer=-1;

procedure TForm1.Chart1MouseMove(Sender: TObject; Shift: TShiftState;
X, Y: Integer);
var tmp : Integer;
begin
tmp:=Series1.Clicked(x,y);

if tmp<>Current then
begin
Current:=tmp;
Series1.Repaint;
end;
end;

procedure TForm1.Series1GetMarkText(Sender: TChartSeries;
ValueIndex: Integer; var MarkText: String);
begin
if ValueIndex <> Current then
MarkText:='';
end;


"Philip E. Jurgenson" <pejurgen (AT) hickorytech (DOT) net> wrote in message
news:4607cdfa (AT) newsgroups (DOT) borland.com...
D2006
TeeChart Standard CodeGear Edition

I've been trying to figure out how to display a single mark for a
value in a bar chart when the mouse moves over a bar. No problem
figuring out which series is referenced, and it's not a problem to
figure out which individual mark is represented by the bar.
However, despite the fact that each mark (TMarksItem) has a
"Visible" property, it doesn't seem to work in a way that's implied
by the help file.

I've tried setting the series' Marks.Visible := True and then
setting each individual mark (Marks.Item[xx].Visible := False) to
not visible - that doesn't seem to work. I've even gone so far as
to change the font color to match the background, then on the
MouseEnter event change the font color to something visible, and
changing it again in the MouseLeave event. This sort of works, but
not very well.

Has anybody tried to do this sort of thing? It's for an application
that only I use, and isn't important enough to spend the money to
upgrade to a version with source. Still, I'd like to know whether
this is possible or not - it'll bug me until I know one way or
another! :-)

Any suggestions appreciated - Thanks!

Phil

--

David,

Thanks for the suggested code above - I'll give that a try, though
it'll be a bit more complicated, since I neglected to mention that the
chart in question uses multiple series in a side-by-side bar form, as
well as a single line series that's displayed over the bars. Given the
multiple-series scenario, your code above won't really work without a
lot of modification...

I'll post a message on the Steema newsgroups as well.

Thanks again!

Phil

--
Back to top
Yeray Alonso
Guest





PostPosted: Thu Mar 29, 2007 8:12 am    Post subject: Re: TeeChart individual marks Reply with quote

Hello Phiplip,
you can do something like following code. I hope it helps. And I'll post
another answer at steema newsgroups with the project as an attachment.

//************************************************* Unit1.pas
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Series, TeEngine, TeeProcs, Chart, ExtCtrls, TeeComma;

type
TForm1 = class(TForm)
TeeCommander1: TTeeCommander;
Chart1: TChart;
Series1: TBarSeries;
Series2: TBarSeries;
Series3: TBarSeries;
Series4: TLineSeries;
procedure FormCreate(Sender: TObject);
procedure Series1GetMarkText(Sender: TChartSeries; ValueIndex: Integer;
var MarkText: String);
procedure Chart1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;
Current: Integer=-1;
CurrSeries: Integer;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
for i:=0 to Chart1.SeriesCount-1 do
begin
Chart1[i].FillSampleValues();
Chart1[i].Marks.Visible:=true;
Chart1[i].OnGetMarkText:= Series1GetMarkText;
end
end;

procedure TForm1.Series1GetMarkText(Sender: TChartSeries;
ValueIndex: Integer; var MarkText: String);
begin
if ((ValueIndex <> Current) or (Sender <> Chart1[CurrSeries])) then
MarkText:='';
end;

procedure TForm1.Chart1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
var i, tmp: Integer;
begin
//Descending loop to consider series ZOrder.
for i:=Chart1.SeriesCount-1 downto 0 do
begin
tmp:=Chart1[i].Clicked(X,Y);

if tmp<>-1 then
begin
Current:=tmp;
CurrSeries:=i;
Chart1[i].Repaint;
break;
end;
end;

end;

end.
//************************************************* end of Unit1.pas


--
Best Regards
Yeray Alonso

Steema Support Central
http://support.steema.com
_______________________



"Philip E. Jurgenson" <pejurgen (AT) hickorytech (DOT) net> wrote in message
news:46080725 (AT) newsgroups (DOT) borland.com...
Quote:
David Berneda wrote:

Hi Philip
Instead of using the MarksItem Visible property you might want to try
using the Series1 "OnGetMarkText" event, and setting the string
parameter to empty string for the marks you want to hide.

See the code below, I think it does what you need.

You might also want to submit your question at our support forms or
public newsgroups so we can verify if the Marksitem Visible property
is working correctly or not.

http://www.steema.com/products/support/support_agreements.html

regards
david
www.teechart.com


var
Current : Integer=-1;

procedure TForm1.Chart1MouseMove(Sender: TObject; Shift: TShiftState;
X, Y: Integer);
var tmp : Integer;
begin
tmp:=Series1.Clicked(x,y);

if tmp<>Current then
begin
Current:=tmp;
Series1.Repaint;
end;
end;

procedure TForm1.Series1GetMarkText(Sender: TChartSeries;
ValueIndex: Integer; var MarkText: String);
begin
if ValueIndex <> Current then
MarkText:='';
end;


"Philip E. Jurgenson" <pejurgen (AT) hickorytech (DOT) net> wrote in message
news:4607cdfa (AT) newsgroups (DOT) borland.com...
D2006
TeeChart Standard CodeGear Edition

I've been trying to figure out how to display a single mark for a
value in a bar chart when the mouse moves over a bar. No problem
figuring out which series is referenced, and it's not a problem to
figure out which individual mark is represented by the bar.
However, despite the fact that each mark (TMarksItem) has a
"Visible" property, it doesn't seem to work in a way that's implied
by the help file.

I've tried setting the series' Marks.Visible := True and then
setting each individual mark (Marks.Item[xx].Visible := False) to
not visible - that doesn't seem to work. I've even gone so far as
to change the font color to match the background, then on the
MouseEnter event change the font color to something visible, and
changing it again in the MouseLeave event. This sort of works, but
not very well.

Has anybody tried to do this sort of thing? It's for an application
that only I use, and isn't important enough to spend the money to
upgrade to a version with source. Still, I'd like to know whether
this is possible or not - it'll bug me until I know one way or
another! :-)

Any suggestions appreciated - Thanks!

Phil

--

David,

Thanks for the suggested code above - I'll give that a try, though
it'll be a bit more complicated, since I neglected to mention that the
chart in question uses multiple series in a side-by-side bar form, as
well as a single line series that's displayed over the bars. Given the
multiple-series scenario, your code above won't really work without a
lot of modification...

I'll post a message on the Steema newsgroups as well.

Thanks again!

Phil

--
Back to top
Philip E. Jurgenson
Guest





PostPosted: Thu Mar 29, 2007 6:05 pm    Post subject: Re: TeeChart individual marks Reply with quote

Yeray Alonso wrote:

Quote:
Hello Phiplip,
you can do something like following code. I hope it helps. And I'll
post another answer at steema newsgroups with the project as an
attachment.


<snip>

Yeray,

Thanks for this - I'll give it a try and see what I think.

It still seems odd to me that simply toggling the individual marks'
..Visible property doesn't work...

Phil

--
Back to top
Narcís Calvet
Guest





PostPosted: Thu Mar 29, 2007 7:39 pm    Post subject: Re: TeeChart individual marks Reply with quote

Hi Philip,

This is just a trick to achieve what you requested. The proper way to
achieve this automatically is using MarkTips tool which is included in
TeeChart Pro v7 VCL

--
Best Regards,

Narcis Calvet
Steema Support Central
http://support.steema.com

"Important note: If you are a TeeChart registered customer, please post your
support questions at Steema's Support monitored Forums for customers:
http://support.steema.com for a prompter reply."


Philip E. Jurgenson wrote:
Quote:
Yeray Alonso wrote:

Hello Phiplip,
you can do something like following code. I hope it helps. And I'll
post another answer at steema newsgroups with the project as an
attachment.


snip

Yeray,

Thanks for this - I'll give it a try and see what I think.

It still seems odd to me that simply toggling the individual marks'
.Visible property doesn't work...

Phil
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Reporting-Charting All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.