DRAW GRAPH
Posted: Tue Feb 23, 2021 1:56 am
hi,
i have made a Diagram from DBF Data and have some Question to optimize
a.) can i "color" Data Value ?
b.) can i "color" Background with different (!) Color ?
Data are from 100-200 so much Space on Button ... how to "fill" better ---
i have made a Diagram from DBF Data and have some Question to optimize
a.) can i "color" Data Value ?
b.) can i "color" Background with different (!) Color ?
Data are from 100-200 so much Space on Button ... how to "fill" better ---
Code: Select all
PROCEDURE ProcDrawGraph()
LOCAL aSerieValues, aValue, aYNames
LOCAL aColors, aDayColor
LOCAL nImageWidth := 800 - 20
LOCAL nImageHeight := 600 - 50
LOCAL hBitmap := 0
LOCAL dDate
aValue:= {}
aYNames := {}
aColors := {}
dDate := CTOD(" . . ")
GO BOTTOM
SKIP -100
DO WHILE !EOF()
AADD(aValue, BLPRESS->DATAPPM)
IF dDate = BLPRESS->PDATE
AADD(aYNames, "" )
ELSE
AADD(aYNames, SUBSTR(DTOC(BLPRESS->PDATE),1,2) )
dDate := BLPRESS->PDATE
ENDIF
* aDayColor := IF( BLPRESS->DATAPPM >= nRangeMax, { 255, 0, 0 }, ;
* IF( BLPRESS->DATAPPM >= nRange3, { 255, 64, 0 }, ;
* IF( BLPRESS->DATAPPM >= nRange2, { 255, 128, 0 }, ;
* IF( BLPRESS->DATAPPM >= nRange1, { 255, 192, 0 }, ;
* IF( BLPRESS->DATAPPM >= nRangeMin, { 255, 255, 0 }, {0,255,0} ) ) ) ) )
*
* AADD(aColors, aDayColor)
SKIP
ENDDO
aSerieValues := {}
AADD(aSerieValues,ACLONE(aValue))
aDayColor := {56,56,56}
AADD(aColors, aDayColor)
DRAW GRAPH ;
IN WINDOW Form_2 ;
AT 10,10 ;
TO nImageHeight,nImageWidth ;
TITLE "BPM" ;
TYPE LINES ;
SERIES aSerieValues ;
YVALUES aYNames ;
DEPTH 1 ;
BARWIDTH 10 ;
HVALUES 20 ;
SERIENAMES { "Jimmy" } ;
COLORS aColors ;
SHOWGRID ;
SHOWXVALUES ;
SHOWYVALUES ;
SHOWLEGENDS ;
NOBORDER
Form_2.Image_1.HBITMAP := hBitmap // Assign hBitmap to the IMAGE control
RETURN