FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour TGraph valores y titulos en negrita
Posts: 98
Joined: Sat Dec 03, 2016 02:49 PM
TGraph valores y titulos en negrita
Posted: Wed May 29, 2019 02:04 PM
Hola Foro:

Solicito una ayuda con la clase Tgraph.

1) Necesito poder destacar los montos de los valores de las barras,
que aparezcan en negrita, lo ideal poner un color de fondo,
para una facil visualizacion. Pues la persona que mira los graficos
tiene muy mala vista.

Como aumento o cambio el FONT y color de esos valores ?

2) Como le cambio el FONT a los nombres de eje X, que sean mas grande.


Le adjunto una foto de lo que deseo hacer y un pequeño programa,
para que alguien me oriente.


Subido en subir imagenes


Gracias por su ayuda,
Saludos.



# Include "Fivewin.Ch"
# Include "TGraph.ch"

FUNCTION Main( oWnd )

LOCAL oDlg, oGraph

DEFINE DIALOG oDlg SIZE 600, 500
oDlg:lHelpIcon := .F.

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

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

oGraph:aYVals = { "Jan", "Feb", "Mar", "Apr", "May" }

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:lLegends := .T.
//oGraph:lViewVal := .T.

ACTIVATE DIALOG oDlg CENTER

RETURN NIL
Posts: 98
Joined: Sat Dec 03, 2016 02:49 PM
Re: TGraph valores y titulos en negrita
Posted: Wed May 29, 2019 08:38 PM

Yo mismo me contesto, para que le sirva a otros amigos del foro:

Se debe definir previamente los font y asignar segun el siguiente orden ( Gracias a un ejemplo del master Uwe ):

FUNCTION SET_FONTS( oGraph )

// oGraph:aFont[1] := aFont[1] // Title
// oGraph:aFont[2] := aFont[2] // xFont
// oGraph:aFont[3] := aFont[3] // yFont
// oGraph:aFont[4] := aFont[4] // Legends
// oGraph:aFont[5] := aFont[5] // Subtitle
// oGraph:aFont[6] := aFont[6] // xTitle
// oGraph:aFont[7] := aFont[7] // y Title
// oGraph:aFont[8] := aFont[8] // Values

oGraph:aFont[1] := TFont():New( "Arial", 0, -16, .F., .T., 0    , 0,  , .F., .F., .F., 0,  3,   2,   1,     ,34 )
oGraph:aFont[2] := TFont():New( "Arial", 0, -18, .F., .T., 0    , 0,  , .F., .F., .F., 0,  3,   2,   1,     , 2 )
oGraph:aFont[3] := TFont():New( "Arial", 0, -14, .F., .T., 900, 0,  , .F., .F., .F., 0,  3,   2,   1,     ,34 )
oGraph:aFont[4] := TFont():New( "Arial", 0, -16, .F., .T., 0    , 0,  , .F., .F., .F., 0,  3,   2,   1,     , 2 )
oGraph:aFont[5] := TFont():New( "Arial", 0, -16, .F., .F., 0    , 0,  , .F., .F., .F., 0,  3,   2,   1,     , 2 )
oGraph:aFont[6] := TFont():New( "Arial", 0, -12, .F., .F., 0    , 0,  , .F., .F., .F., 0,  3,   2,   1,     , 2 )
oGraph:aFont[7] := TFont():New( "Arial", 0, -18, .F., .T., 0    , 0,  , .F., .F., .F., 0,  3,   2,   1,     ,34 )
oGraph:aFont[8] := TFont():New( "Arial", 0, -20, .F., .T., 0    , 0,  , .F., .F., .F., 0,  3,   2,   1,     ,34 )

oGraph:Refresh()

RETURN NIL

Con eso por lo menos puedo poner los titulos y valores a mi gusto.
Si alguien tiene alguna idea de como ponerle sombra a los valores, quedaria mucho mas claro el poder visualizarlos.

Gracias , Saludos
Carito

Continue the discussion