#include "fivewin.ch"
#include "xbrowse.ch"
function main()
local oDlg, oBrw
local oFont
local aData := {}
DEFINE FONT oFont NAME 'TAHOMA' SIZE 0,-12
AAdd( aData, {'A', 12, 450, 130, 330, 155, 80, 70, 80, 90, 111, 166, 100,"A" } )
AAdd( aData, {'B', 130, 230, 155, 80, 12, 500, 70, 80, 90, 111, 166, 200 ,"B"} )
AAdd( aData, {'C', 80, 270, 280, 90, 411, 166, 12, 500, 130, 330, 155, 50 ,"C"} )
AAdd( aData, {'D', 50, 90, 111, 130, 330, 355, 80, 12, 500, 70, 166, 300 ,"D"} )
AAdd( aData, {'E', 330, 330, 155, 180, 412, 470, 70, 80, 90, 111, 166, 300 ,"B"} )
AAdd( aData, {'F', 430, 330, 155, 280, 212, 500, 70, 80, 90, 111, 166, 300 ,"B"} )
AAdd( aData, {'G', 30, 330, 155, 380, 200, 480, 70, 80, 90, 111, 166, 300 ,"B"} )
AAdd( aData, {'H', 430, 330, 155, 480, 312, 250, 70, 80, 90, 111, 166, 300 ,"B"} )
AAdd( aData, {'I', 330, 330, 155, 86, 212, 400, 70, 80, 90, 111, 166, 300 ,"B"} )
AAdd( aData, {'J', 230, 330, 155, 8, 112, 300, 70, 80, 90, 111, 166, 300 ,"B"} )
DEFINE DIALOG oDlg SIZE 1024,440 PIXEL FONT oFont
@ 10, 10 XBROWSE oBrw ;
HEADERS 'Name', 'I','II','III','IV','V','VI','VII','VIII','IX','X','XI','XII','Graph';
SIZE 500, 200 PIXEL ;
OF oDlg ;
ARRAY aData AUTOCOLS ;
LINES
oBrw:nStretchCol := STRETCHCOL_LAST
WITH OBJECT oBrw:aCols[14]
:nHeadStrAlign := AL_CENTER
:nWidth := 200
:bPaintText := { |oCol, hDC, cText, aCoord| DrawText( oCol, hDC, cText, aCoord, oBrw ) }
END
oBrw:nDataLines := 6
oBrw:CreateFromCode()
ACTIVATE DIALOG oDlg CENTERED
RELEASE FONT oFont
return nil
static function DrawText( oCol, hDC, cText, aCoord, oBrw)
local nTop := aCoord[ 1 ], nLeft := aCoord[ 2 ]
local nBottom := aCoord[ 3 ], nRight := aCoord[ 4 ]
local nRow := nTop
local cLine, nFontHt, nAt,oBrush,aRect1:={}
local rcttop := nTop
local rctleft := nLeft
local rctbottom := nBottom
local rctright := nRight
LOCAL I :=0
LOCAL nRowheight := nBottom - nTop
local nWidth := 0
*----------------------------------------------------------
// missing: get the Maxvalue here I use 500
DEFINE BRUSH oBrush COLOR RGB(55,255,55)
FOR I:= 2 to 13
/*
rcttop := INT( rctbottom - nRowheight / 500 * oBrw:aCols[I]:value )
rctleft := rctleft + 25
rctright := rctleft + 20
aRect1 := { rcttop, rctleft, rctbottom, rctright }
FillRect( hDC, aRect1, oBrush:hBrush)
*/
rctleft := rctleft + 25
rcttop := INT( rctbottom - nRowheight / 500 * oBrw:aCols[I]:value )
MoveTo( hDC, rctleft, rcttop )
nWidth:=5
Ellipse( hDC, rctleft - 3, rcttop, rctleft + nWidth - 1, rcttop + nWidth - 1 )
if I < 13
rctright := rctleft + 25
rcttop := INT( rctbottom - nRowheight / 500 * oBrw:aCols[I+1]:value )
LineTo( hDC, rctright, rcttop )
endif
next
oBrush:end()
return nil
*----------------------------------------------------------