Limit TMarksTipTool popup

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
INL2
Newbie
Newbie
Posts: 22
Joined: Mon Aug 18, 2008 12:00 am

Limit TMarksTipTool popup

Post by INL2 » Thu Jun 06, 2013 6:58 pm

I currently have a TMarksTipTool and it pops up every time the mouse is anywhere on the chart (See popup 1).
However, it only updates (calls OnGetText) if the mouse is over actual data in the graph. (See popup 3).

Is there a way to make it so that the popup doesn't happen unless it is over a data item.

Or why does it not call OnGetText before it shows every time, instead of just when it is over new data?

Thanks,
Attachments
popup3.png
Updated when mouse is over the data
popup3.png (19.19 KiB) Viewed 18775 times
popup2.png
Tip not updated unless mouse move over item
popup2.png (20.7 KiB) Viewed 18770 times
popup1.png
Tips shown when not on graph data
popup1.png (18.39 KiB) Viewed 18756 times

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

Re: Limit TMarksTipTool popup

Post by Yeray » Fri Jun 07, 2013 8:47 am

Hi,

Is that a TBarSeries? I've tried to reproduce the problem here but the code below seems to work fine for me:

Code: Select all

uses Series, TeeTools;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.View3D:=false;
  Chart1.AddSeries(TBarSeries).FillSampleValues;
 Chart1.Tools.Add(TMarksTipTool);
end;
I see the popup only when I stop moving the mouse over a bar, and not over an empty space in the chart.
I've also tried assigning a dummy OnGetText event:

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.View3D:=false;

  Chart1.AddSeries(TBarSeries).FillSampleValues;

  with Chart1.Tools.Add(TMarksTipTool) as TMarksTipTool do
  begin
    OnGetText:=MarkTipsGetText;
  end;
end;

procedure TForm1.MarkTipsGetText(Sender:TMarksTipTool; var Text:String);
begin
  Text:='hello';
end;
But I get a similar result. The popup is only shown when I'm over the series.

Could you please arrange a simple example project we can run as-is to reproduce the problem here?
Thanks in advance.
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

INL2
Newbie
Newbie
Posts: 22
Joined: Mon Aug 18, 2008 12:00 am

Re: Limit TMarksTipTool popup

Post by INL2 » Fri Jun 07, 2013 3:00 pm

There are several things in the cart. The one producing the bars is an Area.
Attachments
chart2.png
chart2.png (51.38 KiB) Viewed 18726 times
Chart1.png
Chart1.png (53.77 KiB) Viewed 18743 times

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

Re: Limit TMarksTipTool popup

Post by Yeray » Mon Jun 10, 2013 8:36 am

Hi,

I tried now with this code and the MarkTips tool still doesn't appear when I'm above a part of the chart without any series drawn:

Code: Select all

uses Series;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.View3D:=false;

  Chart1.AddSeries(TLineSeries).FillSampleValues;
  Chart1.AddSeries(THorizLineSeries).FillSampleValues;
  Chart1.AddSeries(TAreaSeries).FillSampleValues;
  Chart1.AddSeries(TPointSeries).FillSampleValues;
  Chart1.AddSeries(TAreaSeries).FillSampleValues;
  Chart1.AddSeries(TPointSeries).FillSampleValues;
  Chart1.AddSeries(TLineSeries).FillSampleValues;

  with Chart1.Tools.Add(TMarksTipTool) as TMarksTipTool do
  begin
    OnGetText:=MarkTipsGetText;
  end;
end;

procedure TForm1.MarkTipsGetText(Sender:TMarksTipTool; var Text:String);
begin
  Text:='hello';
end;
Pleas, arrange a simple example project we can run as-is to reproduce the problem here.
Thanks in advance.
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

INL2
Newbie
Newbie
Posts: 22
Joined: Mon Aug 18, 2008 12:00 am

Re: Limit TMarksTipTool popup

Post by INL2 » Tue Jun 11, 2013 3:33 pm

Here is a simple Form that has the problem.

It doesn't start showing the popup text right away, you have to scroll over a bar for a while first and then move back over the empty space.

It calls the GetText every time you go over a bar, but just displays the last one when you are over the empty area.

INL2
Newbie
Newbie
Posts: 22
Joined: Mon Aug 18, 2008 12:00 am

Re: Limit TMarksTipTool popup

Post by INL2 » Tue Jun 11, 2013 3:36 pm

Didn't accept the dcu and dfm, so I put it in a zip.
Attachments
TChartTest.zip
formMain
(5.43 KiB) Downloaded 634 times

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

Re: Limit TMarksTipTool popup

Post by Narcís » Thu Jun 13, 2013 11:07 am

Hi INL2,

.dcu files are not necessary, they are generated with the compilation process. However, the .pas files are necessary. Could you please also send form's .pas and, if possible, project's .dpr?

Thanks in advance.
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

INL2
Newbie
Newbie
Posts: 22
Joined: Mon Aug 18, 2008 12:00 am

Re: Limit TMarksTipTool popup

Post by INL2 » Mon Jun 17, 2013 1:53 pm

Sorry, I meant to send the .pas, lets try this again.
Attachments
MainFiles.zip
(3.44 KiB) Downloaded 648 times

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

Re: Limit TMarksTipTool popup

Post by Yeray » Wed Jun 19, 2013 11:09 am

Hi,

The project uses TestForm unit that isn't included in the zip. Since I saw FormMain2 is included but not used, I changed one for the other.
MainFiles.zip
(4.21 KiB) Downloaded 716 times
If I deactivate the series that don't have a MarkTips tool assigned, it seems to work fine. Could you please confirm this?
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

INL2
Newbie
Newbie
Posts: 22
Joined: Mon Aug 18, 2008 12:00 am

Re: Limit TMarksTipTool popup

Post by INL2 » Tue Jun 25, 2013 1:03 pm

Still has issues for me.
(See pictures)
The # in the popup is the same.
It pops up when not on the bars.


I remembered we are a version behind because we had some conflicts with your latest version. Is this an issue that has already been fixed.
Attachments
GraphPic2.png
GraphPic2.png (54.28 KiB) Viewed 18587 times
GraphPic1.png
GraphPic1.png (54.2 KiB) Viewed 18592 times

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

Re: Limit TMarksTipTool popup

Post by Narcís » Thu Jun 27, 2013 11:09 am

Hello,

The issue is much simpler. It's just a problem of having 2 area series in a chart with an associated MarkTips tool each. You can reproduce it with the attached project. I think this is a bug and added it (TV52016624) to the defect list to be fixed for future releases. The solution is pretty simple though, you should just have a single MarkTips tool for all series, not associated to any particular series.
Attachments
MultiMarkTips.zip
(2.75 KiB) Downloaded 626 times
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

INL2
Newbie
Newbie
Posts: 22
Joined: Mon Aug 18, 2008 12:00 am

Re: Limit TMarksTipTool popup

Post by INL2 » Wed Aug 28, 2013 9:17 pm

Sorry for the long delay, but project got postponed.

If I make one MarkTips for all the series, how do I know what series I am dealing with inside the function MarkTips___GetText(Sender : TMarksTipTool; var Text : string)

Since sender.Series is nil when you have the "Mark Tips" "Series" assigned to "(all)"

Thanks

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

Re: Limit TMarksTipTool popup

Post by Yeray » Fri Aug 30, 2013 11:04 am

Hi,

You could know it doing something like this:

Code: Select all

procedure TForm1.ChartTool1GetText(Sender: TMarksTipTool;
  var Text: String);
var i: Integer;
    MousePos: TPoint;
begin
  MousePos:=Chart1.GetCursorPos;

  for i:=Chart1.SeriesCount-1 downto 0 do
  begin
    if Chart1[i].Clicked(MousePos)>-1 then
    begin
      Caption:='SeriesIndex: ' + IntToStr(i);
      exit;
    end;
  end;
end;
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

Post Reply