Bug in TGraph

Re: Bug in TGraph

Postby Antonio Linares » Mon Sep 26, 2016 6:40 pm

Enrico,

This aSeries error in fixed in FWH 16.08

thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42093
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Bug in TGraph

Postby Enrico Maria Giordano » Mon Sep 26, 2016 6:45 pm

Thank you, master! :-)

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8713
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Bug in TGraph

Postby Enrico Maria Giordano » Wed Sep 28, 2016 12:18 pm

Unfortunately is not fixed in 16.08. :-(

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8713
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Bug in TGraph

Postby Antonio Linares » Wed Sep 28, 2016 4:44 pm

Enrico,

Should I test the same example that you posted on this thread ?

It worked fine here
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42093
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Bug in TGraph

Postby Enrico Maria Giordano » Wed Sep 28, 2016 5:11 pm

This is the sample:

Code: Select all  Expand view
#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oDlg

    DEFINE DIALOG oDlg

    ACTIVATE DIALOG oDlg;
             ON INIT TEST()

    RETURN NIL


STATIC FUNCTION TEST()

    LOCAL oPrn, oGraph

    LOCAL cTit := "CLIENTI"

    LOCAL aDat := { { 2016, 10, 100 } }

    LOCAL i

    PRNLANDSCAPE()

    PRINT oPrn NAME "Fatturato " + LOWER( cTit ) PREVIEW
        PAGE
            oGraph = TGraph():New()

            oGraph:lXGrid = .T.
            oGraph:lYGrid = .T.

            oGraph:lDotted  = .F.
            oGraph:lTitle   = .T.
            oGraph:lLegends = .F.

            oGraph:cTitle = "FATTURATO " + cTit

            oGraph:nBarSep = 100

            oGraph:lxVal = .T.
            oGraph:lViewVal = .T.

            oGraph:cTitX = "FATTURATO"
            oGraph:cTitY = "ANNI"

            oGraph:aSeries = { { "", RGB( 109, 177, 124 ), 1, .F. } }

            oGraph:aYVals = {}
            oGraph:aData = { {} }

            FOR i = 1 TO LEN( aDat )
                AADD( oGraph:aYVals, LTRIM( STR( aDat[ i, 1 ] ) ) + IF( i > 1, " (" + LTRIM( STR( aDat[ i, 2 ] ) ) + "%)", "" ) )
                AADD( oGraph:aData[ 1 ], aDat[ i, 3 ] )
            NEXT

            oGraph:Print( oPrn, 5 * oPrn:nVertRes() / 66, 5 * oPrn:nHorzRes() / 80, 70 * oPrn:nHorzRes() / 80, 56 * oPrn:nVertRes() / 66 )
        ENDPAGE
    ENDPRINT

    PRNPORTRAIT()

    RETURN NIL


This is the error:

Code: Select all  Expand view
Error description: Error BASE/1087  Argument error: --


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8713
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Bug in TGraph

Postby cnavarro » Wed Sep 28, 2016 10:14 pm

Enrico, for use also with Dialogs, please try with

Code: Select all  Expand view


METHOD Print( oPrn, nTop, nLeft, nWidth, nHeight ) CLASS TGraph

   LOCAL nRight, nBottom, nI, nResV
   LOCAL cOldBitmap:= ::cBitmap
   LOCAL aOldF := { oClone( ::aFont[1] ), oClone( ::aFont[2] ), ;
                    oClone( ::aFont[3] ), oClone( ::aFont[4] ), ;
                    oClone( ::aFont[5] ), oClone( ::aFont[6] ), ;
                    oClone( ::aFont[7] ), oClone( ::aFont[8] ), ;
                    oClone( ::aFont[9] ) }
   ::oPrn    := oPrn
   ::nTRight := 1
   ::nTLeft  := 0
   ::nTCent  := 2
   ::cBitmap := " "

   nRight    := nLeft + nWidth
   nBottom   := nTop  + nHeight

   if !Empty( ::hDC )                  // Add this
      ::oWnd:ReleaseDC()
   endif                                     // Add this



 
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Bug in TGraph

Postby Enrico Maria Giordano » Thu Sep 29, 2016 9:02 am

Thank you. Can you send me the new lib please?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8713
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 101 guests