Hi,
I would very much like to see another version of the Cursor tool that didn't just display the value of a single series.
This would be a vertical line that showed the values of all series it goes through at the point it's cutting the line.
thanks,
nisbus
TCursor tool options
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi nisbus,
You can easily achieve that as shown in the interpolating example I posted here.
Hope this helps!
You can easily achieve that as shown in the interpolating example I posted here.
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 |
Thank you,
This example does exactly what I am trying to do except it shows the values in the chart title.
I would like just the value at the x coordinate of the cursor and the y coordinate of the series (as my screenshot implied).
If I try to use Canvas.TextOut for example how would I then get the y coordinate of each series at the x coordinate of the cursortool?
thanks,
nisbus
This example does exactly what I am trying to do except it shows the values in the chart title.
I would like just the value at the x coordinate of the cursor and the y coordinate of the series (as my screenshot implied).
If I try to use Canvas.TextOut for example how would I then get the y coordinate of each series at the x coordinate of the cursortool?
thanks,
nisbus
I added some thing to your code with the TextOut of the charts canvas and it works pretty well except that the chart always erases my text immediately after drawing the textout.
How can I make it stick?
thanks,
nisbus
How can I make it stick?
Code: Select all
procedure TForm1.ChartTool1Change(Sender: TCursorTool; x, y: Integer;
const XValue, YValue: Double; Series: TChartSeries; ValueIndex: Integer);
var
i: Integer;
ypos : integer;
idx : integer;
begin
With Chart1.Title.Text do
begin
Clear;
for i:=0 to Chart1.SeriesCount - 1 do
begin
idx := Chart1[i].XValues.Locate(Round(XValue));
if idx > -1 then
begin
ypos := Chart1[i].CalcYPos(idx);
Chart1.Canvas.TextOut(x,ypos,FloatToStr(InterpolateLineSeries(Chart1[i],XValue))+#13#10);
end;
Add(Chart1[i].Name + ': Y('+FloatToStr(XValue)+')= ' +
FloatToStr(InterpolateLineSeries(Chart1[i],XValue))+#13#10);
end;
end;
nisbus
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi nisbus,
I couldn't see your screenshot because the image doesn't open properly. Maybe you didn't add it as an URL.
Regarding the problem you are having, it is most likely that it is erased because of the tool being moved again. Maybe the easiest way to solve this would be an annotation or rectangle tool setting its position to custom. You can see an example here.
I couldn't see your screenshot because the image doesn't open properly. Maybe you didn't add it as an URL.
Regarding the problem you are having, it is most likely that it is erased because of the tool being moved again. Maybe the easiest way to solve this would be an annotation or rectangle tool setting its position to custom. You can see an example here.
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 |