Hi,
I need to specify shape (circle) size in axis values, based on required size in pixels (e.g. 20px).
There are functions available like XScreenToValue / YScreenToValue which can help in that regard like:
size:=XScreenToValue(20)-XScreenToValue(0);
Is there a direct function converting pixels to axis value? (I know there is a reverse function Size->Pixels)
regards,
odissey1
pixels to value conversion
Nope, that won't work, X:=CalcXPosValue(Val) is an integer and returns chart point 'X' position for a given axis value 'Val'.8574101 wrote:You can use CalcXPosValue() as following
int X0 = Chart1->Axes->Bottom->CalcXPosValue( 100 );
int Y0 = Chart1->Axes->Left->CalcYPosValue(50);
I am looking for a function inverse to CalcSizeValue:
dX:=Chart1.BottomAxis.CalcSizeValue(Val);
something like
Val:=Chart1.BottomAxis.CalcValueSize(dX);
For example, for pixel size 20 this can be achieved as
Val:=Chart1.BottomAxis.CalcPosPoint(20)-Chart1.BottomAxis.CalcPosPoint(0);
or like this :)
Val:=20 * 1000000.0 / Chart1.BottomAxis.CalcSizeValue(1000000);
But why there is no any straight function?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
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 |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi odissey1,
Thanks for the info.
In that case you can do something like this:
Where pos is an Integer and val and radius are Double variables.
Hope this helps!
Thanks for the info.
In that case you can do something like this:
Code: Select all
pos:=Chart1.Axes.Bottom.IStartPos + 20;
val:=Chart1.Axes.Bottom.CalcPosPoint(pos);
radius:=val-Chart1.Axes.Bottom.Minimum;
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 |