Hi,
I installed an update of TChart and discovered that points of my graph are highlighted when the mouse is hovered over these points.
I have searched sample application, help, support forum etc. (using hover, highlight etc as key words) but I am unable to find info on events and/or properties that allow me to use this feature.
To begin, I would like to use an event to display a series' Name, X and Y values in some controls on my form. Can you point me to some info that describes these features (help topics, forum entries, etc) ?
Thanks!
Help on hover
Re: Help on hover
Hello,
There's an overview of this feature and the possibilities it supports at the What's New document, under "Mouse Hovering".
As with the regular Marks, you set it to show several predefined styles:
If you want further customization in this tool, you can capture the tool's OnGetText event to modify the text being displayed on the same.
Finally, if you want to do other actions when the mouse is over a series, you could always make it yourself using the OnMouseMove event. Ie:
There's an overview of this feature and the possibilities it supports at the What's New document, under "Mouse Hovering".
There's also a tool named TMarksTipTool that allows you to do things like this. You can take a look at the examples under "All features\Welcome !\Tools\Mark tips" in the "Features Demo" program shipped with the installation.Softdrill wrote:To begin, I would like to use an event to display a series' Name, X and Y values in some controls on my form. Can you point me to some info that describes these features (help topics, forum entries, etc) ?
As with the regular Marks, you set it to show several predefined styles:
Code: Select all
TSeriesMarksStyle=( smsValue, { 1234 }
smsPercent, { 12 % }
smsLabel, { Cars } // If label is empty, no mark will be displayed
smsLabelPercent, { Cars 12 % }
smsLabelValue, { Cars 1234 }
smsLegend, { (Legend.Style) }
smsPercentTotal, { 12 % of 1234 }
smsLabelPercentTotal, { Cars 12 % of 1234 }
smsXValue, { 1..2..3.. or 21/6/2014 }
smsXY, { 123 456 }
smsSeriesTitle, { Series1 }
smsPointIndex, { 1..2..3... }
smsPercentRelative, { 100%..90%..120%... }
smsLabelPercentValue, { Cars 12 % 1234 }
smsLabelOrValue { Cars or 1234 } // If label is empty, Value will be used
);
Finally, if you want to do other actions when the mouse is over a series, you could always make it yourself using the OnMouseMove event. Ie:
Code: Select all
uses Series, TeeTools;
procedure TForm1.FormCreate(Sender: TObject);
begin
Chart1.View3D:=false;
Chart1.AddSeries(TPointSeries).FillSampleValues();
Chart1.OnMouseMove:=Chart1MouseMove;
end;
procedure TForm1.Chart1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
var valueIndex: Integer;
begin
valueIndex:=Chart1[0].Clicked(X, Y);
if valueIndex>-1 then
begin
//do whatever you want
end;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Help on hover
Clear... thanks!
One more thing (hopefully it's not too dumb a question): how do I access Mark Tips Tool's properties and events in the IDE?
I opened the chart's editor and added a Mark Tip Tool. Now I like to implement the OnGetText and CancelHint events, but I cannot find these in the IDE (nor can I select the Mark Tip).
Should I manually declare, implement and assing these event handlers in code?
Thanks, Mark
One more thing (hopefully it's not too dumb a question): how do I access Mark Tips Tool's properties and events in the IDE?
I opened the chart's editor and added a Mark Tip Tool. Now I like to implement the OnGetText and CancelHint events, but I cannot find these in the IDE (nor can I select the Mark Tip).
Should I manually declare, implement and assing these event handlers in code?
Thanks, Mark
Re: Help on hover
Hello,
You can find the ChartTools (and the Series) and its events in the Object Inspector:
You can find the ChartTools (and the Series) and its events in the Object Inspector:
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Help on hover
Thanks for that. I overlooked the Structure treeview because I expected the ChartTool to appear in the drop-down box in the Object Inspector.
Strangely enough; once it's been selected in the treeview, it appears in the drop-down box...
Strangely enough; once it's been selected in the treeview, it appears in the drop-down box...