I have a TFastLine Series with big data and i need to show in a box the Cursor->XValue property. The cursor is following the mouse(SnapStyle=ssVertical). The problem is: when the mouse stands in the midddle between 2 X-Values of the Bottom Axis, the cursor moves to next point, while the XValue property of the cursor shows the previous value.
In my application i have big data to show and the chart is zoomed out and i need to be accurate on the value i show.
In the image you can see the error.
I have also made a sample application.
Cursor XValue sometime different from current cursor position
Cursor XValue sometime different from current cursor position
- Attachments
-
- SampleProjForSteema.rar
- (6.96 KiB) Downloaded 572 times
-
- cursor.png (21.85 KiB) Viewed 6725 times
Re: Cursor XValue sometime different from current cursor position
Hello,
What TeeChart version are you using?
It seems to work fine here with v2022.35:
What TeeChart version are you using?
It seems to work fine here with v2022.35:
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Cursor XValue sometime different from current cursor position
Hello,
i'm using Embarcadero 10.4.2 and i've downloaded the last version of TeeChart v2022.35
In installed packages in C++ Builder i see the right paths (...Source Code 2022.35...). The only strange thing i see is the component TChart that shows the version v2022.34.220329 in the Object Inspector.
I need to point that the Cursor error shows when the cursor is EXACTLY in the middle betwwen the two points when slowly moving the mouse from one point to another and stopping in the middle. In the screenshot i've posted above i was moving the mouse slowly from point "1" to point "2" of the bottom axis. When the cursor snap to point "2" i stopped moving the mouse and see the error. In the other cases works well.
i'm using Embarcadero 10.4.2 and i've downloaded the last version of TeeChart v2022.35
In installed packages in C++ Builder i see the right paths (...Source Code 2022.35...). The only strange thing i see is the component TChart that shows the version v2022.34.220329 in the Object Inspector.
I need to point that the Cursor error shows when the cursor is EXACTLY in the middle betwwen the two points when slowly moving the mouse from one point to another and stopping in the middle. In the screenshot i've posted above i was moving the mouse slowly from point "1" to point "2" of the bottom axis. When the cursor snap to point "2" i stopped moving the mouse and see the error. In the other cases works well.
Re: Cursor XValue sometime different from current cursor position
Hello,
The issue here is the OnMouseMove event is triggered before processing the SnapToPoint code so the XValue at that moment still holds the old value.
Instead, you could use the
The issue here is the OnMouseMove event is triggered before processing the SnapToPoint code so the XValue at that moment still holds the old value.
Instead, you could use the
TCursorTool
's OnSnapChange
event. Ie:
Code: Select all
//...
#include <VCLTee.TeeTools.hpp>
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published: // IDE-managed Components
//...
private: // User declarations
void __fastcall CursorSnapChange(TCursorTool* Sender, int x, int y, const double XValue, const double YValue, Vcltee::Teengine::TChartSeries* Series, int ValueIndex);
Code: Select all
void __fastcall TForm1::FormCreate(TObject *Sender)
{
//...
cursor->OnSnapChange = CursorSnapChange;
}
void __fastcall TForm1::CursorSnapChange(TCursorTool* Sender, int x, int y, const double XValue, const double YValue, Vcltee::Teengine::TChartSeries* Series, int ValueIndex)
{
double d;
d = cursor->XValue;
Edit1->Text = d;
}
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Cursor XValue sometime different from current cursor position
Hello, thank you very much for your support, now all works well.