#include "Fivewin.ch"
#include "TGraph.ch"
#Define GRAPH_3D_SI .T.
#Define GRAPH_3D_NO .F.
FUNCTION MAIN()
LOCAL oDlg, oGraph, oBtn
#ifdef __CLIPPER__
SET RESOURCES TO "Test.Dll"
#else
SET RESOURCES TO "Test32.Dll"
#endif
DEFINE DIALOG oDlg;
SIZE 600, 500
@ 3, 1 GRAPH oGraph;
SIZE 250, 200;
TYPE GRAPH_TYPE_BAR;
YVALUES 3D XGRID YGRID XVALUES LEGENDS
// oGraph:aSeries = { { "Serie 1", CLR_CYAN } }
// { cLegend, nColor, nType, l3D }
oGraph:aSeries = { { "Serie 1", CLR_CYAN , , },;//BAR y 3D por defecto
{ "Serie 2", CLR_HBLUE, GRAPH_TYPE_LINE, GRAPH_3D_SI },;
{ "Serie 3", CLR_HRED, GRAPH_TYPE_POINT, GRAPH_3D_NO,.T.,.T.,.T.,"Rojo" } }
oGraph:aYVals = { "Jan", "Feb", "Mar", "Apr", "May" }
// oGraph:aData = { { 14280, 20420, 12870, 25347, 7640 } }
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:nPoint= 2 //Cross
oGraph:lLine = .T. //muestra la linea amarilla en BAR
oGraph:lViewSRLegend = .T.
oGraph:cToolTip = {|oGph,nSerie,nPos,nVal| oGph:aSeries[nSerie][1]+CRLF+oGraph:aYVals[nPos]+": "+cValToChar(nVal)}
@ 0, 0 BTNBMP oBtn RESOURCE "Bars" ACTION ( oGraph:nType := 1, oGraph:Refresh() )
@ oBtn:nTop, oBtn:nRight+1 BTNBMP oBtn RESOURCE "Lines" PIXEL ACTION ( oGraph:nType := 2, oGraph:Refresh() )
@ oBtn:nTop, oBtn:nRight+1 BTNBMP oBtn RESOURCE "Points" PIXEL ACTION ( oGraph:nType := 3, oGraph:Refresh() )
@ oBtn:nTop, oBtn:nRight+1 BTNBMP oBtn RESOURCE "Pie" PIXEL ACTION ( oGraph:nType := 4, oGraph:Refresh() )
@ oBtn:nTop, oBtn:nRight+1 BTNBMP oBtn RESOURCE "3D" PIXEL ACTION (oGraph:l3D :=!oGraph:l3D ,oGraph:Refresh())
@ oBtn:nTop, oBtn:nRight+1 BTNBMP oBtn RESOURCE "xGrid" PIXEL ACTION (oGraph:lxGrid :=!oGraph:lxGrid ,oGraph:Refresh())
@ oBtn:nTop, oBtn:nRight+1 BTNBMP oBtn RESOURCE "yGrid" PIXEL ACTION (oGraph:lyGrid :=!oGraph:lyGrid ,oGraph:Refresh())
ACTIVATE DIALOG oDlg;
CENTER
SET RESOURCES TO
RETURN NIL