Good day,
Currently I am using the interpolation formula too axis my Y - values, but I found that my values does not match according to what the grid say.
My question is as follows :
I know what my x value is : example 2015-09-11 ( xval := Chart1.Axes.Bottom.CalcPosPoint(X);
Why cant I now loop through TCHartGrid for each column and each row and go and get each matching y value for each series matching my "Date"
Please see attached example.
Easier way to axis Y value
Re: Easier way to axis Y value
Hello,
I guess your function calculates each value taking in consideration the 10 last values from the sources series. This makes the function to have a shift/lag of 10 values.
To present this lag in the grid with the XValues synchronized, it would mean the first 10 rows on the function section would be empty and that wouldn't be true; the series linked to the function is populated from the index=0 to the index="source count - period - 1".
I guess your function calculates each value taking in consideration the 10 last values from the sources series. This makes the function to have a shift/lag of 10 values.
To present this lag in the grid with the XValues synchronized, it would mean the first 10 rows on the function section would be empty and that wouldn't be true; the series linked to the function is populated from the index=0 to the index="source count - period - 1".
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Easier way to axis Y value
Sorry I think I lost you,
The only thing I asking if it is possible when my mouse is on the x axis, cant I get the exact value that is in the TchartGrid.
Example x = 2015/08/31
Give me the exact value of all Y series for the 2018/08/31; The answer in this case is 52.632 for Series 2
The only thing I asking if it is possible when my mouse is on the x axis, cant I get the exact value that is in the TchartGrid.
Example x = 2015/08/31
Give me the exact value of all Y series for the 2018/08/31; The answer in this case is 52.632 for Series 2
Re: Easier way to axis Y value
Hello,
I misunderstood you, I'm sorry.
I think you are doing almost exactly the same that is being done here. Just change OnClick event for OnMouseMove event and Chart1[0].XValue[minDistIndex] for Chart1[0].YValue[minDistIndex].
I misunderstood you, I'm sorry.
I think you are doing almost exactly the same that is being done here. Just change OnClick event for OnMouseMove event and Chart1[0].XValue[minDistIndex] for Chart1[0].YValue[minDistIndex].
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Easier way to axis Y value
This is what I am trying to explain
procedure TForm6.Chart1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
var Index,IndexLine : Integer;
xval , stock : Double;
begin
Index := tmpMyCandle.Clicked(X, Y); // GET INDEX OF CLICK CANDLE
xval := Chart1.Axes.Bottom.CalcPosPoint(X); //INDEX OF X AXIS -> WE HAVE THE DATE NOW
MouseCloseAnnot.Active:=Index<>-1;
FloatToStr(tmpMyCandle.CloseValues[Index]); // WE HAVE THE CLOSE VALUE FOR THE DAY THIS IS PERFECT !!!!!!!!!!!!!!
///QUESTION why cant we with a line series do the similar as a a candle series, or dont I understand something not right
procedure TForm6.Chart1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
var Index,IndexLine : Integer;
xval , stock : Double;
begin
Index := tmpMyCandle.Clicked(X, Y); // GET INDEX OF CLICK CANDLE
xval := Chart1.Axes.Bottom.CalcPosPoint(X); //INDEX OF X AXIS -> WE HAVE THE DATE NOW
MouseCloseAnnot.Active:=Index<>-1;
FloatToStr(tmpMyCandle.CloseValues[Index]); // WE HAVE THE CLOSE VALUE FOR THE DAY THIS IS PERFECT !!!!!!!!!!!!!!
///QUESTION why cant we with a line series do the similar as a a candle series, or dont I understand something not right
Re: Easier way to axis Y value
Hello,
This should work in the same way for a TLineSeries. The only difference is that a TLineSeries draws line segments between two values, so when the mouse is over a line segment, the Clicked function will return the index of the point on the left.
But in the first post you mentioned "interpolation", so I guess you are already doing something like in the example at All features\Welcome!\Chart Styles\Standard\Line (Strip)\Interpolating Line series in the features demo.
If you still find problems with it, please try to arrange a simple example project we can run as-is to reproduce the problem here.
This should work in the same way for a TLineSeries. The only difference is that a TLineSeries draws line segments between two values, so when the mouse is over a line segment, the Clicked function will return the index of the point on the left.
But in the first post you mentioned "interpolation", so I guess you are already doing something like in the example at All features\Welcome!\Chart Styles\Standard\Line (Strip)\Interpolating Line series in the features demo.
If you still find problems with it, please try to arrange a simple example project we can run as-is to reproduce the problem here.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Easier way to axis Y value
Hi,
I please see sample code with explanation.
Here is another screen shot of what I am trying,
I please see sample code with explanation.
Here is another screen shot of what I am trying,
- Attachments
-
- sample.zip
- (11.59 KiB) Downloaded 677 times
Re: Easier way to axis Y value
Hello,
There are still some details I still don't understand. Ie, I'm not sure if you want the YValue corresponding to the mouse X position or corresponding to the label under the mouse.
Taking the code from the Interpolating Line series example I pointed out in the last post, I modified your example showing a few variations:
There are still some details I still don't understand. Ie, I'm not sure if you want the YValue corresponding to the mouse X position or corresponding to the label under the mouse.
Taking the code from the Interpolating Line series example I pointed out in the last post, I modified your example showing a few variations:
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Easier way to axis Y value
Good day,
Sorry for the late reply, thank you very much this is exactly what I was looking for.
Have a nice day
Sorry for the late reply, thank you very much this is exactly what I was looking for.
Have a nice day