Steema Issues Database

Note: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;
otherwise you can use StackOverflow.
Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy.



Bug 1053 - TMarksTipTool.OnGetText event - Sender.Series not set
Summary: TMarksTipTool.OnGetText event - Sender.Series not set
Status: RESOLVED NOTABUG
Alias: None
Product: VCL TeeChart
Classification: Unclassified
Component: Chart (show other bugs)
Version: 140923
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Steema Issue Manager
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-17 12:35 EST by ChristianH
Modified: 2015-01-08 06:49 EST (History)
1 user (show)

See Also:
Chart Series: ---
Delphi / C++ Builder RAD IDE Version:


Attachments
Demo (2.51 KB, application/x-zip-compressed)
2014-12-22 11:29 EST, ChristianH
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ChristianH 2014-12-17 12:35:08 EST
In the TMarksTipTool.OnGetText event the Sender.Series property is not set (i.e. it's nil).

E.g. to confirm...

procedure TForm.ChartTool1GetText(Sender: TMarksTipTool; var Text: string);
begin
  if Sender.Series = nil then
    Self.Caption := 'Sender.Series = nil'
  else
    Self.Caption := Sender.Series.Name;
end;
Comment 1 sandra pazos 2014-12-22 11:05:02 EST
Hello ChristianH, 

We can't reproduce the problem here; the MarkTipsTool is different to Nil for us. Could you please attach a complete example where we can reproduce the problem you are experiencing? 

Thanks in advance,
Regards.
Comment 2 ChristianH 2014-12-22 11:29:54 EST
Created attachment 366 [details]
Demo

Find attached sample which demonstrates that problem.
Comment 3 sandra pazos 2014-12-24 08:57:19 EST
Hello,

Many thanks for the project you attached here. The problem you are experiencing is produced because there isn't any series assigned to MarksTipTool . If you don't want get a null value, is necessary assign a series to the tool. 

Thanks in advance,
Comment 4 ChristianH 2014-12-27 03:29:42 EST
I am wondering about the design of that series property. 
1. If no series is attached, then in the designer it is displayed as "All".
2. If that "All" is selected, then the event is fired for every series. So I would expect, that within that event I will get the information which series caused that event to be fired!!

So, IMO this is a bug.
Comment 5 sandra pazos 2014-12-29 06:11:08 EST
Hello, 
The Sender.Series of MarkTipsTool GetText event isn't an event parameter is a tool property and it must be assigned a specific series if you want the tool Sender.Series isn't nil. Also, you should consider that you are using tool event instead of the Series event. Therefore it isn't a bug is tool design.  Analysing the example you sent us, I think you can use the GetMarksText Series event. You only need add the lines code below in GetMarksText:     

...
procedure TForm6.Series1GetMarkText(Sender: TChartSeries; ValueIndex: Integer;
  var MarkText: string);
begin
     if Sender = nil then
    Listbox.Items.Add('Sender.Series = nil')
  else
    Listbox.Items.Add(Sender.Name);
end;
...

Thanks in advance