TGRAPH

TGRAPH

Postby MarcoBoschi » Mon Jan 28, 2013 4:35 pm

Hi,
I have to scale a linear TGRAPH

For example
Code: Select all  Expand view
#Include "FiveWin.Ch"

Function Main()
   LOCAL aMisura := {}
   LOCAL aOra    := {}
   LOCAL oWnd , oGraph

   aMisura := { 136.08, 136.08, 136.05, 136.10, 136.10, 137.10, 136.70, 136.70, 137.11, 137.90, 137.60 }

   DEFINE WINDOW oWnd FROM 1, 1 TO 20, 80 TITLE "Misure"

   oGraph:=TGraph():New( 0 , 0 , oWnd ,oWnd:nWidth()-8 , oWnd:nHeight()-40 )
   oGraph:SetYVals( aOra )
   oGraph:cTitX   := "Misura"
   oGraph:cTitY   := "Ora"
   oGraph:lYVal   :=.T.
   oGraph:lLegends:=.T.
   oGraph:nType   := 2

   oGraph:AddSerie( aMisura , "MISURE" , RGB( 128 , 128 ,255 ) )

   ACTIVATE WINDOW oWnd ;
      ON PAINT ( oGraph:nWidth :=  oWnd:nWidth  - 8 , ;
                 oGraph:nHeight := oWnd:nHeight -40 , ;
                 oGraph:Refresh(.f.))


RETURN (NIL)


This is graph.
Image
I want this
I want set min and max in Y Axes

Image

This is created by excel

Image

many thanks
marco
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: TGRAPH

Postby Marcelo Via Giglio » Tue Jan 29, 2013 1:51 am

Marcelo Via Giglio
 
Posts: 1064
Joined: Fri Oct 07, 2005 3:33 pm
Location: Cochabamba - Bolivia

Re: TGRAPH

Postby MarcoBoschi » Tue Jan 29, 2013 9:48 am

Hi Marcelo,
sorry but I can not get it to work!
:oops:
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: TGRAPH

Postby Marcelo Via Giglio » Tue Jan 29, 2013 2:07 pm

Marco,

sorry, you are right, this modification worked with old version of tGraph, let me time to see if I found an old modified version of tGraph

regards

Marcelo
Marcelo Via Giglio
 
Posts: 1064
Joined: Fri Oct 07, 2005 3:33 pm
Location: Cochabamba - Bolivia

Re: TGRAPH

Postby MarcoBoschi » Tue Jan 29, 2013 2:13 pm

Marcelo,
I have FWH dated 26 october 2009

Many thanks
Marco
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: TGRAPH

Postby James Bott » Wed Jan 30, 2013 5:22 pm

Marco,

I don't know if this will work, but try setting oGraph:nMinVal to whatever you want. Let us know if that works.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: TGRAPH

Postby James Bott » Wed Jan 30, 2013 5:28 pm

OK, I tested it an setting nMinVal doesn't work. Sorry.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: TGRAPH

Postby James Bott » Wed Jan 30, 2013 6:07 pm

Well I did find that you can adjust the number of increments for the labels on the Y axis.

oGraph:nXRanges:= 5

nXRanges defaults to 4. Note that it is actually named incorrectly since these are the Y axis ranges so it should be nYRanges. I would be nice if there was also a similar setting for the X-axis.

I still have not been able to find class vars for the Y axis minimum and maximum values. I don't think they exist.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: TGRAPH

Postby James Bott » Wed Jan 30, 2013 7:02 pm

OK, I have spent about an hour looking for a var for the Y-axis minimum and I don't see one. I fear that zero is being used so it may be impossible to set the min y-axis value without some major modifications to TGraph.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: TGRAPH

Postby Silvio.Falconi » Wed Jan 30, 2013 7:52 pm

I spend this afternoon.. and then I asked help to Alfredo...but he not sent any messages until now
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7056
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 106 guests