Limit TMarksTipTool popup
Limit TMarksTipTool popup
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,
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
-
- Updated when mouse is over the data
- popup3.png (19.19 KiB) Viewed 18965 times
-
- Tip not updated unless mouse move over item
- popup2.png (20.7 KiB) Viewed 18960 times
-
- Tips shown when not on graph data
- popup1.png (18.39 KiB) Viewed 18946 times
Re: Limit TMarksTipTool popup
Hi,
Is that a TBarSeries? I've tried to reproduce the problem here but the code below seems to work fine for me:
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:
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.
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'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;
Could you please arrange a simple example project we can run as-is to reproduce the problem here?
Thanks in advance.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Limit TMarksTipTool popup
There are several things in the cart. The one producing the bars is an Area.
- Attachments
-
- chart2.png (51.38 KiB) Viewed 18916 times
-
- Chart1.png (53.77 KiB) Viewed 18933 times
Re: Limit TMarksTipTool popup
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:
Pleas, arrange a simple example project we can run as-is to reproduce the problem here.
Thanks in advance.
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;
Thanks in advance.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Limit TMarksTipTool popup
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.
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.
Re: Limit TMarksTipTool popup
Didn't accept the dcu and dfm, so I put it in a zip.
- Attachments
-
- TChartTest.zip
- formMain
- (5.43 KiB) Downloaded 650 times
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Limit TMarksTipTool popup
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.
.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 |
Instructions - How to post in this forum |
Re: Limit TMarksTipTool popup
Sorry, I meant to send the .pas, lets try this again.
- Attachments
-
- MainFiles.zip
- (3.44 KiB) Downloaded 666 times
Re: Limit TMarksTipTool popup
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. If I deactivate the series that don't have a MarkTips tool assigned, it seems to work fine. Could you please confirm this?
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. 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,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Limit TMarksTipTool popup
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.
(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 (54.28 KiB) Viewed 18777 times
-
- GraphPic1.png (54.2 KiB) Viewed 18782 times
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Limit TMarksTipTool popup
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.
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 639 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 |
Instructions - How to post in this forum |
Re: Limit TMarksTipTool popup
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
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
Re: Limit TMarksTipTool popup
Hi,
You could know it doing something like this:
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,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |