Series Marks
Series Marks
I am using TeeChart 7 with Delphi 2006. I want the series marks to display the yvalue when the user hovers over the mark. I think I should use the OnGetSeriesMark event but I don't know how to call it or create it. Can someone provide some guidance?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi McMClark,
In that case it will be easier, you just need to set marks style like this:
You'll also find several mark text event examples searchin on the forums for OnGetMarkText.
Hope this helps!
In that case it will be easier, you just need to set marks style like this:
Code: Select all
Series1.Marks.Style:=smsValue;
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 |
Instructions - How to post in this forum |
Thanks for your reply.
I am still have a difficulty getting the YValue to appear when I hover over the mark (I still get the XValue). I use the following code:
tmpDefaultSeries := frmDefaultResultGraphAndDocuments.GetDefaultSeries(intDefaultAggChartSeries, tmpAggSeries);
DBChart1.AddSeries(tmpDefaultSeries);
DBChart1.Legend.Visible := True;
DBChart1.Legend.CheckBoxes := True;
intList2 := ds1.RecordCount;
with tmpDefaultSeries do
begin
DataSource := ds1;
YValues.ValueSource := 'Aggregates';
XLabelsSource := 'PublicationDate';
XValues.ValueSource := 'PublicationDate';
try
XValues.DateTime := True;
except
end;
Title := strSubModel + ' ' + strSeriesName;
tmpDefaultSeries.ColorEachPoint := False;
tmpDefaultSeries.Marks.Style := smsValue;
DBChart1.Draw;
end;
Can you tell me what I am doing wrong?
I am still have a difficulty getting the YValue to appear when I hover over the mark (I still get the XValue). I use the following code:
tmpDefaultSeries := frmDefaultResultGraphAndDocuments.GetDefaultSeries(intDefaultAggChartSeries, tmpAggSeries);
DBChart1.AddSeries(tmpDefaultSeries);
DBChart1.Legend.Visible := True;
DBChart1.Legend.CheckBoxes := True;
intList2 := ds1.RecordCount;
with tmpDefaultSeries do
begin
DataSource := ds1;
YValues.ValueSource := 'Aggregates';
XLabelsSource := 'PublicationDate';
XValues.ValueSource := 'PublicationDate';
try
XValues.DateTime := True;
except
end;
Title := strSubModel + ' ' + strSeriesName;
tmpDefaultSeries.ColorEachPoint := False;
tmpDefaultSeries.Marks.Style := smsValue;
DBChart1.Draw;
end;
Can you tell me what I am doing wrong?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi McMClark,
Code below works fine for me here:
If the problem persists could you please send us a simple example project we can run "as-is" to reproduce the problem here? You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Alternatively you can use OnGetMarkText event like this:
Thanks in advance.
Code below works fine for me here:
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
for i:=0 to 10 do
Series1.AddXY(i, random, 'point ' + IntToStr(i));
Series1.Marks.Visible:=true;
Series1.Marks.Style:=smsValue;
end;
Alternatively you can use OnGetMarkText event like this:
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
for i:=0 to 10 do
Series1.AddXY(i, random, 'point ' + IntToStr(i));
Series1.Marks.Visible:=true;
//Series1.Marks.Style:=smsValue;
end;
procedure TForm1.Series1GetMarkText(Sender: TChartSeries;
ValueIndex: Integer; var MarkText: String);
begin
MarkText:=FloatToStr(Series1.YValue[ValueIndex]);
end;
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |