Does anyone know if it is possible to set the scales of a graph programmatically? I want to set the maximum and minimum values of the Y axis. From looking at the class code, it doesn't seem possible.
Regards,
James
Does anyone know if it is possible to set the scales of a graph programmatically? I want to set the maximum and minimum values of the Y axis. From looking at the class code, it doesn't seem possible.
Regards,
James
Dear James,
did you resolve it?
bye
marco
Marco,
No, I never did. But I didn't really spend much time on it.
My version of TGraph is from 3/23/2008. If you have a newer version of FWH then you might have a newer version of TGraph.prg (in the source folder).
If not, then author's name and email address is in the PRG. You might contact him to see if there is a later version.
Regards,
James
James I not understood how want make if you explain I can try to see it ..
Silvio,
Currently TGraph figures out the max and min value for each axis based on the data. This can lead to some very odd labeling of increments. For instance the graph I am currently using shows the Y-Axis from 0 to 250 (which is actually OK), but there are only 4 increments for the labels so you get labels of 0.00, 62.50, 125.00, 187.50, 250.00. This isn't actually that bad, but it would be better divided into 5 increments so the labels would read 0, 50, 100, 150, 200, 250.
So, it would seem that the easiest way to handle this would be to allow the programmer to set the min and max of the axis and the number of increments for the labeling.
I don't need this for the x-axis right now, but I am sure it would also be useful.
Of course, it would still be useful to have it operate as it does now since you often don't know the range of the data you are processing.
Since TGraph is a very complex program capable of doing some complex graphing it would probably be best if we could get the author to add these features.
For me the changes are not a pressing need, since I have been using this chart for a couple of years now. Others may need this capability though.
I wish to thank Alfredo Arteaga, the author of TGraph for writing this awesome program. One of the very first programs I wrote almost 30 years ago, was a graphing program and it was not easy.
Regards,
James
James,
Thank you very much.
In Italy "just in time" means "I do not know what to do" "but tomorrow it must be on line"
I will try to adapt it to my need
marco
...
DATA nMax INIT 0
... // Max, Min values
IF ::nMax != 0
nMax := IF( ::nMaxVal <> 0 , ::nMaxVal , 0 )
FOR nJ := 1 TO Len( ::aSeries )
FOR nI :=1 TO Len( ::aData[nJ] )
nMax := Max( ::aData[nJ][nI], nMax )
NEXT nI
NEXT nJ
ELSE
nMax := ::nMax
ENDIFOK
MANY THANKS
![]()
![]()
![]()
![]()
![]()
Marco,
Were you ever able to set the range of the Y-axis?
James
hallo,
can you post a samples of tgraph use?
thanks
damianodec,
>can you post a samples of tgraph use?
There is a test.prg in the TGraph file that shows a number of example graphs.
Regards,
James