hcunha Posted June 13, 2011 Report Share Posted June 13, 2011 Ola a todos, Estou usando a classe tgraph pra gerar meus gráficos. Mas todos os gráficos aparecem o percentual, valores e nome das colunas. Queria pra aparecer só os percentuais no gráfico. Alguem sabe como fazer isso ? Desde ja agradeço a ajuda. Helio Cunha Helio Cunha GControl Tecnologia hfcunha@hotmail.com xHarbour 0.99 - xMate - MySql 4.1 - SqlLib Quote Link to comment Share on other sites More sharing options...
hcunha Posted June 13, 2011 Author Report Share Posted June 13, 2011 Ola a todos, Estou usando a classe tgraph pra gerar meus gráficos. Mas todos os gráficos aparecem o percentual, valores e nome das colunas. Queria pra aparecer só os percentuais no gráfico. Alguem sabe como fazer isso ? Desde ja agradeço a ajuda. Helio Cunha Helio Cunha GControl Tecnologia hfcunha@hotmail.com xHarbour 0.99 - xMate - MySql 4.1 - SqlLib Quote Link to comment Share on other sites More sharing options...
ricardomouramarques Posted June 13, 2011 Report Share Posted June 13, 2011 Vc tem várias opções aÃ. Veja as variáveis de instância: lxGrid lyGrid lDotted lxVal // mostra valores na HORIZONTAL lyVal // mostra valores na VERTICAL lTitle // mosrta o titulo lLegends // mostra a legenda lViewVal // ver valores etc. etc. Então basta vc mudar o valor de qaulquer uma pra mostrar ou não. Tipo: oGraph:lViewVal := .f. Quote Link to comment Share on other sites More sharing options...
Theotokos Posted June 13, 2011 Report Share Posted June 13, 2011 PRIVATE oDlg, oGraph, oGet[11], oImg[3] PRIVATE aSerie := { } PRIVATE aLegenda := { } PRIVATE aColors := {CLR_BROWN,CLR_BLUE,CLR_GREEN,CLR_CYAN,CLR_RED,; CLR_MAGENTA,CLR_HGRAY,CLR_HBLUE,CLR_HGREEN,CLR_HCYAN,CLR_HRED,; CLR_HMAGENTA,CLR_YELLOW } * nMes1 := Month(Date()) ; nMes2 := Month(Date()) nAno1 := Year(Date()) ; nAno2 := Year(Date()) * cFormato := Pad("1-Barra",15) l3D := .t. lLegenda := .t. lxValor := .t. lyValor := .t. lViewValor := .t. lSelViewer := .t. * DEFINE DIALOG oDlg RESOURCE "DLG_GRAFICO" TITLE "Gráfico do Crediário a Receber e Recebido" * oGraph := TGraph():Redefine(4001, oDlg, "Grafico " ) * REDEFINE GET oGet[1] VAR nMes1 Picture "99" UPDATE ID 4003 Of oDlg REDEFINE GET oGet[2] VAR nAno1 Picture "9999" UPDATE ID 4006 Of oDlg REDEFINE GET oGet[3] VAR nMes2 Picture "99" UPDATE ID 4008 Of oDlg REDEFINE GET oGet[4] VAR nAno2 Picture "9999" UPDATE ID 4011 Of oDlg * REDEFINE COMBOBOX oGet[5] Var cFormato PROMPTS {"1-Barra","2-Linhas","3-Pontos","4-Pizza","5-Barra e Linhas","6-Area"} UPDATE ID 4013 OF oDlg ; ON CHANGE ( oGraph:nType := Val(SubStr(cFormato,1,1)), oGraph:Refresh() ) * REDEFINE CHECKBOX oGet[6] VAR l3D ID 4015 UPDATE Of oDlg ON CLICK (oGraph:l3D := l3d, oGraph:Refresh()) REDEFINE CHECKBOX oGet[7] VAR lLegenda ID 4016 UPDATE Of oDlg ON CLICK (oGraph:lLegends := lLegenda, oGraph:Refresh()) * REDEFINE CHECKBOX oGet VAR lxValor ID 4020 UPDATE Of oDlg ON CLICK (oGraph:lxVal := lxValor , oGraph:Refresh()) REDEFINE CHECKBOX oGet[9] VAR lyValor ID 4022 UPDATE Of oDlg ON CLICK (oGraph:lyVal := lyValor , oGraph:Refresh()) REDEFINE CHECKBOX oGet[10] VAR lViewValor ID 4021 UPDATE Of oDlg ON CLICK (oGraph:lViewVal := lViewValor , oGraph:Refresh()) REDEFINE CHECKBOX oGet[11] VAR lSelViewer ID 4023 UPDATE Of oDlg ON CLICK (oGraph:lSelView := lSelViewer , oGraph:Refresh()) * REDEFINE BUTTON ID 4017 OF oDlg ACTION ( MsgRun("Gerando Gráfico...","Gerar",{|| GeraGraCred1() }) ) REDEFINE BUTTON ID 4018 OF oDlg ACTION ( MsgRun("Imprimindo Gráfico","Imprimir", {|| PrtGrafico(oGraph,; "Gráfico de Crediário a Receber e Recebido - PerÃodo : " + Str(nMes1,2) + "/" + Str(nAno1,4) + " a " + ; Str(nMes2,2) + "/" + Str(nAno2,4) )} )) REDEFINE BUTTON ID 4019 OF oDlg ACTION (oDlg:End()) * oGraph:l3D := l3D oGraph:lLegends := lLegenda * oGraph:lxVal := lxValor oGraph:lyVal := lyValor oGraph:lViewVal := lViewValor oGraph:lSelView := lSelViewer * oGraph:AddSerie(aSerie,"") * ACTIVATE DIALOG oDlg CENTERED id=code>id=code> Quote Link to comment Share on other sites More sharing options...
hcunha Posted June 14, 2011 Author Report Share Posted June 14, 2011 Amigos, obrigado pela ajuda mas não deu certo. Ja troquei as variaveis pra .f. depois pra .t. mas nada. Vejam a minha rotina. Ja testei de varias formas e não da certo. Quero que apareça somente os percentuais nas barras do grafico de pizza e ta aparecendo os percentuais e valores. DEFINE FONT oFontT NAME "Times New Roman" SIZE 0,-18 BOLD ITALIC DEFINE FONT oFontX NAME "Times New Roman" SIZE 0,-10 DEFINE FONT oFontY NAME "Times New Roman" SIZE 0,-10 geragraf := .t. ograph:=TGraph():New(122,605,t_relat,400,360) if g3d ograph:l3D := !ograph:l3D else ograph:l3D := ograph:l3D endif oGraph:lLegends:= .t. oGraph:lxVal := .t. oGraph:lyVal := .t. oGraph:lSelView:= .t. oGraph:lDotted := .t. ograph:lViewVal:= .t. // mostra os valores de cada barra. ograph:nClrV := CLR_BLACK // cor dos valores de cada barra ograph:cPicture:= "9,999,999.99" ograph:lPopUp := .t. ograph:cTitle := "LUCRATIVIDADE - "+dtoc(dini)+" a "+dtoc(dfim) ograph:nType := 4 ograph:lcTitle := .f. ograph:nClrT := RGB( 55, 55, 55) ograph:nClrX := CLR_BLUE ograph:nClrY := CLR_RED oGraph:aFont[1]:=oFontT oGraph:aFont[2]:=oFontX oGraph:aFont[3]:=oFontY ograph:AddSerie( aValores, versao , RGB(150,150,150) ) ograph:SetYVals( aClientes ) ograph:Refresh(.f.) ofontt:end() ofontx:end() ofonty:end() Onde estou errando ? Helio Cunha GControl Tecnologia hfcunha@hotmail.com xHarbour 0.99 - xMate - MySql 4.1 - SqlLib Quote Link to comment Share on other sites More sharing options...
ricardomouramarques Posted June 14, 2011 Report Share Posted June 14, 2011 olha aà um exemplo: #include "Fivewin.ch" #include "TGraph.ch" FUNCTION MAIN() LOCAL oDlg, oGraph DEFINE DIALOG oDlg SIZE 600, 500 @ 1, 1 GRAPH oGraph; SIZE 250, 200; TYPE 4; YVALUES 3D XGRID YGRID XVALUES LEGENDS PIXEL oGraph:aSeries = { { "Serie 1", CLR_CYAN },; { "Serie 2", CLR_YELLOW },; { "Serie 3", CLR_HRED } } oGraph:aData = { { 35 }, {40}, {25} } oGraph:nClrX = CLR_GREEN oGraph:nClrY = CLR_RED ACTIVATE DIALOG oDlg CENTER RETURN NIL id=code>id=code> Quote Link to comment Share on other sites More sharing options...
hcunha Posted June 16, 2011 Author Report Share Posted June 16, 2011 Ricardo O Gráfico eu sei fazer. O que quero é que apareça só os percentuais no gráfico de pizza. Ta aparecendo os percentuais com valores e nome dos clientes. Quero so os percentuais. Helio Cunha GControl Tecnologia hfcunha@hotmail.com xHarbour 0.99 - xMate - MySql 4.1 - SqlLib Quote Link to comment Share on other sites More sharing options...
ricardomouramarques Posted June 16, 2011 Report Share Posted June 16, 2011 neste exemplo que te mandei, aparece somente os percentuais. Testa ele aà Ricado Marques Araguari-MG Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.