Page 1 of 1

bug FWH 15.05 - clase TGraph

Posted: Mon May 11, 2015 2:43 pm
by MOISES
Error description: Error BASE/1132 Error de rango: acceso al array
Args:
[ 1] = A { ... }
[ 2] = N 13

Stack Calls
===========
Called from: .\source\classes\TGRAPH.PRG => (b)TGRAPH_MOUSEMOVE( 1139 )
Called from: .\source\classes\TGRAPH.PRG => TGRAPH:MOUSEMOVE( 1140 )


Un saludo

Re: bug FWH 15.05 - clase TGraph

Posted: Mon May 11, 2015 3:39 pm
by karinha

Re: bug FWH 15.05 - clase TGraph

Posted: Thu May 14, 2015 3:17 pm
by MOISES
Hola Antonio:

Dime algo por favor de este bug.

Gracias.

Re: bug FWH 15.05 - clase TGraph

Posted: Thu May 14, 2015 4:57 pm
by Antonio Linares
Moisés,

Tienes un ejemplo para reproducir el bug ? gracias

Re: bug FWH 15.05 - clase TGraph

Posted: Thu May 14, 2015 8:14 pm
by MOISES
Claro:

Code: Select all | Expand



#include "Fivewin.ch"
#include "TGraph.ch"


FUNCTION MAIN()

    LOCAL oDlg, oGraph

    DEFINE DIALOG oDlg;
           SIZE 600, 500

    @ 1, 1 GRAPH oGraph;
           SIZE 250, 200;
           TYPE 1;
           YVALUES 3D XGRID YGRID XVALUES LEGENDS


    oGraph:aSeries = { { "Serie 1", CLR_CYAN ,, },;
                       { "Serie 2", CLR_YELLOW,, },;
                       { "Serie 3", CLR_HRED,, } }


    oGraph:aData = { { 14280, 20420, 12870, 25347, 7640 },;
                     { 8350, 10315, 15870, 5347, 12340 },;
                     { 12345, -8945, 10560, 15600, 17610 } }

    oGraph:nClrX = CLR_GREEN
    oGraph:nClrY = CLR_RED

/*
    oGraph:cToolTip =  { | nAt, nSerie, nIndex | nSerie := If( nAt % ;
                         Len( oGraph:aSeries ) == 0, Len( oGraph:aSeries ),;
                         Int( nAt % Len( oGraph:aSeries ) ) ),;
                         "Series: " + Alltrim( Str( nSerie ) ) + CRLF + ;
                         "Bar: " + AllTrim( Str( nIndex := Int( nAt / Len( oGraph:aSeries ) ) + 1 + ;
                         If( nAt % Len( oGraph:aSeries ) == 0, -1, 0 ) ) ) + CRLF + ;
                         "Value: " + AllTrim( Str( oGraph:aData[ nSerie ][ nIndex ] ) ) }
*/

    @ 0, 0 BUTTON "Cambia" ACTION sysrefresh()  

    ACTIVATE DIALOG oDlg;
             CENTER

    RETURN NIL

 



Pasa el ratón por el gráfico.

Muchas gracias.

Re: bug FWH 15.05 - clase TGraph

Posted: Fri May 15, 2015 8:07 am
by Antonio Linares
Moisés,

Así parece solucionarse, puedes probarlo ?

Code: Select all | Expand

METHOD MouseMove( nRow, nCol, nFlags ) CLASS TGraph

   local nAt := 0

   if ! Empty( ::aBarCoors )
      nAt = AScan( ::aBarCoors,;
         { | aCoors | nRow <= aCoors[ 2 ] .and. ;
                      nRow >= aCoors[ 2 ] - aCoors[ 3 ] .and. ;
                      nCol >= aCoors[ 1 ] .and. ;
                      nCol <= aCoors[ 1 ] + aCoors[ 4 ] } )
      if nAt != 0
         if Len( ::aData[ 1 ] ) >= nAt
            DEFAULT ::cToolTip := { | nAt | AllTrim( Transform( ::aData[ 1 ][ nAt ],;
                                    "999,999,999.99" ) ) }
            ::ShowToolTip( nRow, nCol, Eval( ::cToolTip, nAt ) )
         endif                 
      else
         ::DestroyTooltip()  
      endif  
   endif                  
                                 
return nil
 

Re: bug FWH 15.05 - clase TGraph

Posted: Fri May 15, 2015 4:53 pm
by Silvio.Falconi
seem run ok now

but why it crash with sysrefresh ?

Re: bug FWH 15.05 - clase TGraph

Posted: Mon May 18, 2015 3:49 pm
by MOISES
Antonio:

Por favor, ¿me puedes enviar al correo la clase entera corregida para probarlo?.

Muchas gracias.

Re: bug FWH 15.05 - clase TGraph

Posted: Mon May 18, 2015 5:01 pm
by Antonio Linares
Moisés,

Enviada

Re: bug FWH 15.05 - clase TGraph

Posted: Sat May 23, 2015 7:10 am
by MOISES
Hola Antonio:

En efecto, el error no se produce.

Sin embargo, activando los oGraph:cToolTip, sólo funciona en la parte de la izquierda, si se coloca el mouse en las barras de la mitad derecha no se muestra nada.

Muchas gracias.

Re: bug FWH 15.05 - clase TGraph

Posted: Wed May 27, 2015 5:46 pm
by MOISES
Hola Antonio:

¿Lo has podido arreglar por favor?.

Muchas gracias.

Re: bug FWH 15.05 - clase TGraph

Posted: Wed May 27, 2015 7:25 pm
by Antonio Linares
Moisés,

Asi se soluciona:

Code: Select all | Expand

METHOD MouseMove( nRow, nCol, nFlags ) CLASS TGraph

   local nAt := 0

   if ! Empty( ::aBarCoors )
      nAt = AScan( ::aBarCoors,;
         { | aCoors | nRow <= aCoors[ 2 ] .and. ;
                      nRow >= aCoors[ 2 ] - aCoors[ 3 ] .and. ;
                      nCol >= aCoors[ 1 ] .and. ;
                      nCol <= aCoors[ 1 ] + aCoors[ 4 ] } )
      if nAt != 0
         DEFAULT ::cToolTip := { | nAt | AllTrim( Transform( ::aData[ 1 ][ nAt ],;
                                 "999,999,999.99" ) ) }
         ::ShowToolTip( nRow, nCol, Eval( ::cToolTip, nAt ) )
      else
         ::DestroyTooltip()  
      endif  
   endif                  
                                 
return nil
 


Aún así la barra inferior no muestra nada