Page 1 of 1

X / Y Values at cursor position?

Posted: Mon Nov 26, 2007 6:24 am
by 9349911
Hi support,

how is it possible to have the actual x / y values at the cursor tool like here:
Image

And a second question ...
Have a look at this picture:
Image

You can see a highlighted X value from the cursor (9.0) at the bottom axis. Would this be possible in the future? Maybe with a new tool ?

Posted: Mon Nov 26, 2007 10:07 am
by yeray
Hi Dominik,

1) You can use OnChange event from the Cursor Tool to obtain its actual X and Y values.

2) You can use the Annotation Tool and calculate its position at the event I pointed to you before.

The following code shows you an example of how you can achieve both things. Note that ChartTool1 is the Cursor Tool and the ChartTool2 is the Annotation Tool.

Code: Select all

procedure TForm1.ChartTool1Change(Sender: TCursorTool; x, y: Integer;
  const XValue, YValue: Double; Series: TChartSeries; ValueIndex: Integer);
begin
  ChartTool2.Text := floattostr(XValue);
  Chart1.Draw;
  ChartTool2.Shape.Left := Chart1.Axes.Bottom.CalcXPosValue(XValue) - (ChartTool2.Shape.Width div 2);
  Caption := 'X: ' + floattostr(XValue) + '    Y: ' + floattostr(YValue);
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  ChartTool2.PositionUnits := muPixels;
  ChartTool2.Shape.CustomPosition := true;

  Chart1.Draw;

  ChartTool2.Shape.Top := Chart1.Axes.Bottom.PosAxis + 20;
end;

Posted: Mon Nov 26, 2007 10:16 am
by 9349911
Hi Yeray,

I will do some tests with your suggestion.

Thx for the moment !

Posted: Mon Nov 26, 2007 1:23 pm
by 9349911
Hi Yeray,

works perfect !

Thx !

Posted: Tue Nov 27, 2007 1:42 pm
by 9349911
Hi Yeray,

well I did some extra tests and it works. But one think is a problem .. If I enable the annotation for displaying the text the CPU usage is very high. I have a dual core mobile cpu and one cpu is at 100% while moving the cursor tool.

Do you have a solution that is less cpu hungry :? ?

Posted: Tue Nov 27, 2007 2:51 pm
by 9236620
Probier mal, ob Du das CursorTool mit Pfeiltasten bewegen kannst. Wenn Du mit der Maus arbeitest, wird das OnMouseOver mit einigen hundert Hz gefeuert. Dazu wird jedesmal der Wert rausgesucht -> macht den Rechner langsam.
Wenn Du das mit Tasten machst, kommt da höchstens Deine Wiederholrate raus.

Grüße, Ulfert

Posted: Tue Nov 27, 2007 3:36 pm
by 9349911
Tja aber die Bedienung erfolgt nunmal mit der Maus.
Insofern habe ich da ein kleines Problem fürchte ich.

Posted: Tue Nov 27, 2007 5:42 pm
by narcis
Hello Messie and moelski,

We would appreciate if you posted your messages in those forums in English so that the most part of users can understand them and benefit from the knowledge base they are. We don't have any inconvenient if you post your messages in German and English either.

Thanks in advance.

Posted: Tue Nov 27, 2007 5:49 pm
by 9349911
Hi Narcis,

well me latest question is still in english.

And I will write my next posts in english only.

Posted: Tue Nov 27, 2007 6:13 pm
by narcis
Hi Dominik,
well me latest question is still in english.
Yes, I've done tests with Core Duo and Pentium IV CPUs and haven't been able to reproduce the issue. Tomorrow I'll try with a dual core machine. Should I follow any specific step to reproduce the problem here? Can you reproduce it with the example at All Features\Welcome!\Tools\Cursor\Synchronizing Two in the features demo?
And I will write my next posts in english only.
Thanks!

Posted: Tue Nov 27, 2007 10:06 pm
by 9349911
Hi Narcis,

I can send you a simple demo which has a lot of CPU load at my laptop.
I add an entry here is I uploaded it to your server.

Posted: Wed Nov 28, 2007 8:36 am
by narcis
Hi Dominik,

I'm not able to reproduce it with a Pentium Dual Core CPU either. Where have you posted your example, I can't find it.

Thanks in advance.

Posted: Fri Nov 30, 2007 7:29 am
by 9349911
Hi Narcis,

Sorry had no time yesterday for write a demo.
But I have uploaded it now: "Received Mess Demo Simple.rar Content Type application/octet-stream Length 16618"

If I make the window very large and move the cursor (and check "Show values"), then the cpu usage is very high.

Maybe I do something generally wrong ?!

Posted: Fri Nov 30, 2007 10:18 am
by narcis
Hi Dominik,

Thanks for the example project but I haven't been able to reproduce the problem here. I tested this in a Dual Core and Pentium IV machines without success. Have you been able to reproduce this in other machines?

It could be a graphic problem at your end. You could try updating the graphic card driver or checking its configuration.