FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Bug in TGraph
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Bug in TGraph
Posted: Mon Sep 26, 2016 06:40 PM

Enrico,

This aSeries error in fixed in FWH 16.08

thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: Bug in TGraph
Posted: Wed Sep 28, 2016 12:18 PM

Unfortunately is not fixed in 16.08. :-(

EMG

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Bug in TGraph
Posted: Wed Sep 28, 2016 04: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
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: Bug in TGraph
Posted: Wed Sep 28, 2016 05:11 PM
This is the sample:

Code (fw): Select all Collapse
#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 (fw): Select all Collapse
Error description: Error BASE/1087  Argument error: --


EMG
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Bug in TGraph
Posted: Wed Sep 28, 2016 10:14 PM
Enrico, for use also with Dialogs, please try with

Code (fw): Select all Collapse
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
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: Bug in TGraph
Posted: Thu Sep 29, 2016 09:02 AM

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

EMG

Continue the discussion