hi,
I'm working with TGRAPH class and have this graph:
I would like get this kind of alignment:
is it possible?
thanks
STATIC FUNCTION BUILDFONT( aFont )
IF EMPTY( aFont[ LF_FACENAME ] )
MsgAlert( "No Font selected !","Break" )
RETURN NIL
ENDIF
RETURN TFont():New( aFont[ LF_FACENAME ],;
,;
aFont[ LF_HEIGHT ],;
.f.,;
!( aFont[ LF_WEIGHT ] == 400 ),;
aFont[ LF_ESCAPEMENT ],;
aFont[ LF_ORIENTATION ],;
aFont[ LF_WEIGHT ],;
aFont[ LF_ITALIC ],;
aFont[ LF_UNDERLINE ],;
aFont[ LF_STRIKEOUT ],;
aFont[ LF_CHARSET ],;
aFont[ LF_OUTPRECISION ],;
aFont[ LF_CLIPPRECISION ],;
aFont[ LF_QUALITY ],;
,;
aFont[ LF_PITCHANDFAMILY ] )
DEFINE FONT oFont NAME "Tahoma" SIZE 0, -11
DEFINE FONT oFontY NAME "Courier new" SIZE 0, -8
oFont45 := oFontY:Rotate( 450 )
mieiFont[3] := oFont45
DEFINE DIALOG oDlg2 SIZE 1080,600 PIXEL FONT oFont;
STYLE nOR( DS_MODALFRAME, WS_POPUP, WS_CAPTION, WS_SYSMENU, ;
WS_MINIMIZEBOX, WS_THICKFRAME ) ;
TITLE "Periodo di riferimento: "+DtoC(m_get[01])+" - "+dtoc(m_get[02])
// grafico 1
@ 10, 1 GRAPH oGraph1;
SIZE 180, 80 PIXEL ;
TYPE GRAPH_TYPE_BAR;
YVALUES XGRID XVALUES
oGraph1:aSeries = {{ m_get[21], CLR_CYAN }}
oGraph1:aYVals = aResiYval
oGraph1:aData = {aResiPerc}
oGraph1:nClrX = CLR_GREEN
oGraph1:nClrY = CLR_RED
oGraph1:nMinVal = 0
oGraph1:lDegrade = .t.
oGraph1:cTitle := m_get[21]+" %"
oGraph1:cToolTip = {|oGph,nSerie,nPos,nVal| oGraph1:aYVals[nPos]+": "+cValToChar(Round(nVal,2))}
oGraph1:SetFonts(mieiFont)
METHOD Paint( nTop, nLeft, nBottom, nRight ) CLASS TGraph
...
local oFont45
oFont45 := ::aFont[3]:Rotate( 450 )
IF lyVal .AND. Len(::aYVals)>0 // Show yLabels
nI := nLeft + nWide
FOR nJ := 1 TO ::nMax()
* ::Say(nBottom+ 5, nI-nDeep, ::aYVals[nJ], ::aFont[3], ::nClrY, ::nTCent)
::Say(nBottom+ 5, nI-nDeep, ::aYVals[nJ], oFont45, ::nClrY, ::nTCent)
nI += nWide
NEXT
ENDIF
oGraph1:SetFonts(mieiFont)
nType // Graph Type
nDegrade // Degrade bars color 0, 1, 2
l3D // Show 3D
lxGrid // Show Grid
lyGrid // Show Grid
lDotted // Grid Dotted
lxVal // Show xValues
lyVal // Show yValues
nBarD // Deep bar
lTitle // Show Title
lLegends // Show Legends
cTitle // Graph Title
cPicture // Mask values
aSeries // Series
aData // Data
aSTemp // Series
aDTemp // Data
aYVals // yValues
aYTemp // yValues
aFont // Title, xFont, yFont, Legends
// Subtitle, xTitle, yTitle, Values
nClrT // Color titles
nClrX // Color x labels
nClrY // Color y labels
nClrL // Color legends
nClrV // Color values
nClrST // Color subtitle
nClrXT // Color xTitle
nClrYT // Color yTitle
nPieX // Pie graph pos
nPieSt // Start pie (angle)
nPoint // Point type
nBarSep // Bar Separator
nXRanges // n Ranges
nValues // Pie values (Serie/Period)
lViewVal // View values
nClr, hPen, hOldPen // Pen handles
nPenWidth // Graph line pen width
lBorders // Borders
lcTitle // Center title
nClrGrid // Grid color
nClrBack // Background color
nClrBLeg // Back legend color
cBitmap // Background bitmap
cSubTit // Subtitle
cTitX // xTitle
cTitY // yTitle
nMaxVal // Max Value
nMinVal // Min Value
lLine // Yellow line
lPopUp // PopUp menu
lSelView // Select view option
lSelBack // Select back option
lFull // All Graph Area
nLanguage // Language (1-English, 2-Spanish, 3-...)
aSTitle INIT {.T.,.T.,.T.,.T.} // Shadow titles
nTRight // Right align
nTLeft // Left align
nTCent // Cent align
oPrn // Printer object by Galvez
lBordLeg INIT .T. // Legend border by dREHER
...
...
ACTIVATE DIALOG oDlg CENTER ON INIT SET_FONTS( oGraph ) // FONTS on INIT !!!
SET RESOURCES TO
RETURN NIL
// ----------------
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
// METHOD New(
// 1 cFaceName,
// 2 nWidth,
// 3 nHeight,
// 4 lFromUser,;
// 5 lBold,
// 6 nEscapement,
// 7 nOrientation,
// 8 nWeight,
// 9 lItalic,;
// 10 lUnderline,
// 11 lStrikeOut,
// 12 nCharSet,
// 13 nOutPrecision,;
// 14 nClipPrecision,
// 15 nQuality,
// 16 oDevice,
// 17 nPitchFamily )
// 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
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
ACTIVATE DIALOG oDlg CENTERED ;
ON INIT ( oVert := oGraph:aFont[ 3 ]:Rotate(), ;
oGraph:SetFonts( { nil, nil, oVert } ), ;
oVert:End() )
#include "TTitle.ch"
...
...
ACTIVATE DIALOG oDlg CENTER ;
ON INIT SET_VAL( oGraph, oDlg )
SET RESOURCES TO
RETURN NIL
// ----------------
FUNCTION SET_VAL( oGraph, oDlg )
LOCAL oText1, oTitle1, oTitle2
@ 450, 68 TITLE oTitle1 SIZE 500, 100 OF oDlg TRANSPARENT NOBORDER
@ 57, 75 TITLETEXT oText1 OF oTitle1 TEXT "Test 1" FONT oFont90 COLOR 255
@ 57, 160 TITLETEXT oText1 OF oTitle1 TEXT "Test 2" FONT oFont90 COLOR 16711680
@ 57, 245 TITLETEXT oText1 OF oTitle1 TEXT "Test 3" FONT oFont90 COLOR 32768
@ 57, 330 TITLETEXT oText1 OF oTitle1 TEXT "Test 4" FONT oFont90 COLOR 16711935
@ 57, 415 TITLETEXT oText1 OF oTitle1 TEXT "Test 5" FONT oFont90 COLOR 128
@ 95, 540 TITLE oTitle2 SIZE 200, 200 OF oDlg TRANSPARENT NOSHADOW NOBORDER
oTitle2:aGrdBack := {}
@ 5, 5 TITLEIMG OF oTitle2 BITMAP "Favorite.bmp" SIZE 60, 60 ;
TRANSPARENT ANIMA ;
ACTION YOUR_ACTION()
...
...
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 99 guests