marcioe Posted May 10, 2018 Report Share Posted May 10, 2018 Controle de mesas de Bares e Restaurantes Teria como fazer algo parecido com o da imagem abaixo Vejam Quote Link to comment Share on other sites More sharing options...
marcioe Posted May 11, 2018 Author Report Share Posted May 11, 2018 Claro que em fivewin Quote Link to comment Share on other sites More sharing options...
ram_bh Posted May 11, 2018 Report Share Posted May 11, 2018 Claro que em fivewin Acho que com a classe Metro você vai conseguir... Quote Link to comment Share on other sites More sharing options...
Luiz Fernando Posted May 11, 2018 Report Share Posted May 11, 2018 a uns 7 anos atras estava com um projeto de hotel, tinha criado o layout toda logica, mais devido a região que estou acabou não sendo viavel continuar, acredito que vc possa aproveitar a mesma logica para mesa, vou disponibilizar o projeto para quem queira tocar ele em frente. https://uploaddeimagens.com.br/imagens/five_1-png https://uploaddeimagens.com.br/imagens/five_2-png https://uploaddeimagens.com.br/imagens/five_3-png segue projeto(apenas defini o layout, a ideia seria algo interativo, aonde apenas de olhar para tela, o usuario iria saber se chave esta no apartamento, se ja tomou cafe, se a faxina foi realizada, tudo usando monitor touch, por isto este visual) https://www.sendspace.com/file/qmju2r emotta 1 Quote Link to comment Share on other sites More sharing options...
emotta Posted May 11, 2018 Report Share Posted May 11, 2018 EMPRESOFT esse grafico estilo pizza que classe vc usou? tem um exemplo simples de código só dele? achei show de bola Quote Link to comment Share on other sites More sharing options...
Luiz Fernando Posted May 11, 2018 Report Share Posted May 11, 2018 EMPRESOFT esse grafico estilo pizza que classe vc usou? tem um exemplo simples de código só dele? achei show de bola emotta é o RMCHART, foi apresentado no congresso de 2007 pelo Evandro, é muito simples sua utilização, de uma olhada no fonte acima, o duro que ali só tem o de pizza, vou procurar aqui o pacote dele completo com todos exemplos, tem varios modelo com visual muito atraente , achando posto aqui, ou caso algum colega tiver ai. abs Quote Link to comment Share on other sites More sharing options...
marcioe Posted May 11, 2018 Author Report Share Posted May 11, 2018 Obrigado amigo Empresoft por Responder.... mas está dando erro quando baixo e tento descompactar ele dá erro Quote Link to comment Share on other sites More sharing options...
Luiz Fernando Posted May 12, 2018 Report Share Posted May 12, 2018 Marcio embora lhe passei por skype deixar o novo link aqui , para quem quizer https://www.sendspace.com/file/5icgue Quote Link to comment Share on other sites More sharing options...
sambomb Posted May 14, 2018 Report Share Posted May 14, 2018 Crie todos os botões que precisar e vai exibindo/escondendo conforme precisar Quote Link to comment Share on other sites More sharing options...
marcioe Posted May 14, 2018 Author Report Share Posted May 14, 2018 Olá amigo sambomb quanto a Exibir e Ocultar o Botão tá BLZ, porem eu não queria colocar "FIXO" A posição do botão Exemplo mesa 01, mesa 02, mesa 04, mesa 09, mesa 15 Ou seja sem ocupar o espaço da 02,03 .... 05,06,07,08 por exemplo. Eu fiz no PAINT a edição dos botões apenas para ilustrar Quote Link to comment Share on other sites More sharing options...
sambomb Posted May 14, 2018 Report Share Posted May 14, 2018 Você pode fazer uma função para mover os botões com base em um array, algo tipo isso: Local aMesas := {}, nMargemHorizontal := 0, nMargemVertical := 0, nAltura := 0, nLargura := 0 Local nPosX := 0, nPosY := 0 aAdd(aMesas,{.T.,oBtn[1]}) aAdd(aMesas,{.T.,oBtn[2]}) aAdd(aMesas,{.F.,oBtn[3]}) aAdd(aMesas,{.T.,oBtn[4]}) nMargemHorizontal := 8 nMargemVertical := 8 nPosX := nMargemHorizontal nPosY := nMargemVertical nLargura := 60 nAltura := 60 For i := 1 to Len(aMesas) if (aMesas[i,MESA_ATIVA]) aMesas[i,MESA_BOTAO]:Enable() aMesas[i,MESA_BOTAO]:Show() If ( nPosX + nLargura ) > oDlg:nWidth nPosY += nAltura + nMargemVertical nPosX := nMargemHorizontal end aMesas[i,MESA_BOTAO]:Move( nPosY, nPosX, nLargura, nAltura, .T. ) nPosX += nLargura else aMesas[i,MESA_BOTAO]:Disable() aMesas[i,MESA_BOTAO]:Hide() end aMesas[i,MESA_BOTAO]:Refresh() end Quote Link to comment Share on other sites More sharing options...
Jose Sebastiao Posted May 22, 2018 Report Share Posted May 22, 2018 Boa Noite, tenho um sistema pra restaurantes, e tenho interesse neste seu projeto de Hotel, como faço ? Quote Link to comment Share on other sites More sharing options...
Luiz Fernando Posted May 23, 2018 Report Share Posted May 23, 2018 Boa Noite, tenho um sistema pra restaurantes, e tenho interesse neste seu projeto de Hotel, como faço ? Ola deixei o link do projeto acima, segue ele novamente. https://www.sendspace.com/file/5icgue Luiz Fernando Quote Link to comment Share on other sites More sharing options...
evertonlb Posted June 4, 2018 Report Share Posted June 4, 2018 EMPRESOFT esse grafico estilo pizza que classe vc usou? tem um exemplo simples de código só dele? achei show de bola EMPRESOFT esse grafico estilo pizza que classe vc usou? tem um exemplo simples de código só dele? achei show de bola Pessoal.. não lembro de onde peguei isso.. mas são funções para usar o RMChart. Segue os PRG´s #include "FiveWin.ch" //Para RMCHart #include "hbdll.ch" #include "Rmchart.ch" #include "DllxHb.ch" #include "cstruct.ch" #include "wintypes.ch" #include "RMChart2.ch" /* // GridlessSeries styles #define RMC_PIE_FLAT 51 #define RMC_PIE_GRADIENT 52 #define RMC_PIE_3D 53 #define RMC_PIE_3D_GRADIENT 54 #define RMC_DONUT_FLAT 55 #define RMC_DONUT_GRADIENT 56 #define RMC_DONUT_3D 57 #define RMC_DONUT_3D_GRADIENT 58 #define RMC_PYRAMIDE 59 #define RMC_PYRAMIDE3 60 // Pie and Donut alignments #define RMC_FULL 1 #define RMC_HALF_TOP 2 #define RMC_HALF_RIGHT 3 #define RMC_HALF_BOTTOM 4 #define RMC_HALF_LEFT 5 */ // ****************************************************************************** * Sistema .....: BS.Escola * Programa ....: EjemPastel.prg * Autor .......: Everton Battiston * Sintese .....: Gera Graficos Pizza e Donuts * Data ........: 19/8/2011 às 00:23:11 * Revisado em .: 19/8/2011 às 00:23:11 ****************************************************************************** PROCEDURE EjemPastel(ccTitulo, ccTituloLateral, vValores, vLabels, vLegendas) LOCAL cPath PUBLIC gcTitulo, gaVals, gnEstilo, gaLegend, gnAlign PUBLIC p_nTipo, p_nEstilo, IdG cPath := CurDrive()+":\"+CurDir() gcTitulo := ccTitulo + " " + CRLF + " " + ccTituloLateral gnEstilo := RMC_PIE_3D_GRADIENT gnAlign := RMC_FULL gaVals := vValores gaLegend := vLegendas IF YEAR(DATE()) < 2099 SET EPOCH TO (YEAR( DATE() ) - 80) ELSE SET EPOCH TO 2000 ENDIF SET DATE TO FRENCH hRmcDll := LoadLibrary( "RMCHART.DLL" ) SETHandle(hRmcDll) //Send hRmcDll to Rmc4xHb.prg SET _3DLOOK ON DEFINE BRUSH oBrush COLOR GetSysColor(15) DEFINE DIALOG oWnd TITLE "Veesor Gráficos" from 50, 50 TO 600, 570 PIXEL COLOR 0, 15591915 *SET MESSAGE OF oWnd TO "de: José Murugosa" ; *CENTERED DATE KEYBOARD 2007 ACTIVATE DIALOG oWnd; ON INIT ( BuildMenu(oWnd), IdG := gPastel( oWnd, gcTitulo, gnEstilo, gnAlign, gaVals, gaLegend ) ) centered RETURN *---------------------------- FUNCTION BuildMenu() //Permite seleccionar Tipo y Estilo de Gráfico MENU oMenu // 2007 MENUITEM "Tipo de Gráfico" ; ACTION nil ; MESSAGE "Gráfico Sem Grade" MENU MENUITEM "Pizza" ; ACTION nil ; MESSAGE "Gráfico Pizza" MENU MENUITEM "Pizza Plano" ; ACTION IdG := gPastel( oWnd, gcTitulo, RMC_PIE_FLAT, gnAlign, gaVals, gaLegend ) ; MESSAGE "Gráfico Pizza Plano" MENUITEM "Pizza Plano com Gradiente" ; ACTION IdG := gPastel( oWnd, gcTitulo, RMC_PIE_GRADIENT, gnAlign, gaVals, gaLegend ) ; MESSAGE "Gráfico Pizza Plano com Gradiente" MENUITEM "Pizza 3D" ; ACTION IdG := gPastel( oWnd, gcTitulo, RMC_PIE_3D, gnAlign, gaVals, gaLegend ) ; MESSAGE "Gráfico Pizza 3D" MENUITEM "Pizza 3D com Gradiente" ; ACTION IdG := gPastel( oWnd, gcTitulo, RMC_PIE_3D_GRADIENT, gnAlign, gaVals, gaLegend ) ; MESSAGE "Gráfico Pizza 3D com Gradiente" ENDMENU MENUITEM "Donuts" ; ACTION nil ; MESSAGE "Grafico Donuts" MENU MENUITEM "Donuts Plano" ; ACTION IdG := gPastel( oWnd, gcTitulo, RMC_DONUT_FLAT, gnAlign, gaVals, gaLegend ) ; MESSAGE "Gráfico de Donuts plano" MENUITEM "Donuts Plano c/Gradiente" ; ACTION IdG := gPastel( oWnd, gcTitulo, RMC_DONUT_GRADIENT, gnAlign, gaVals, gaLegend ) ; MESSAGE "Gráfico de Donuts com Gradiente" MENUITEM "Donuts 3d" ; ACTION IdG := gPastel( oWnd, gcTitulo, RMC_DONUT_3D, gnAlign, gaVals, gaLegend ) ; MESSAGE "Gráfico de Donuts 3D" MENUITEM "Donuts 3d com Gradiente" ; ACTION IdG := gPastel( oWnd, gcTitulo, RMC_DONUT_3D_GRADIENT, gnAlign, gaVals, gaLegend ) ; MESSAGE "Gráfico Donuts 3D com Gradiente" ENDMENU MENUITEM "Piramide" ; ACTION nil ; MESSAGE "Grafico em Pirâmide" MENU MENUITEM "Pirâmide" ; ACTION IdG := gPastel( oWnd, gcTitulo, RMC_PYRAMIDE, gnAlign, gaVals, gaLegend ) ; MESSAGE "Gráfico Pizza 3D com Gradiente" MENUITEM "Pirâmide 3D" ; ACTION IdG := gPastel( oWnd, gcTitulo, RMC_PYRAMIDE3, gnAlign, gaVals, gaLegend ) ; MESSAGE "Gráfico Pizza 3D com Gradiente" ENDMENU ENDMENU MENUITEM "Ações" ; ACTION nil ; MESSAGE "Ações sobre o Gráfico" MENU MENUITEM "Guardar como Imagem" ; ACTION RMC_DRAW2FILE( IdG, "grafico.jpg",,, 100 ) ; MESSAGE "Guardar gráfico como Imagem JPG" MENUITEM "Enviar à Àrea de Transferência" ; ACTION RMC_DRAW2CLIPBOARD( IdG, P_nTipo ) ; MESSAGE "Enviar Gráfico à Àrea de Transferência" MENUITEM "Imprimir" ; ACTION RMC_DRAW2PRINTER( IdG ) ; MESSAGE "Imprimir o Gráfico" ENDMENU ENDMENU oWnd:SetMenu(oMenu) RETURN .t. FUNCTION EstiloBarras( nEst ) P_nEstilo := nEst FOR i=1 to Len( gaVals ) RMC_SetSeriesStyle( IdG, 1, i, P_nEstilo ) NEXT i RMC_DRAW( IdG ) RETURN nil FUNCTION TipoBarras( ntipo ) gnTipo:=ntipo gnEstilo := RMC_BAR_FLAT IdG := gBarras( oWnd, gcTitulo, gcTituloY, gaVals, gaXLabels, gnTipo, gnEstilo, gaLegSeries, glEtiqVals ) RETURN nil FUNCTION EsHorizontal( lh ) IdG := gBarras( oWnd, gcTitulo, gcTituloY, gaVals, gaXLabels, gnTipo, gnEstilo, gaLegSeries, glEtiqVals, lh ) return NIL #include "FiveWin.ch" //Para RMCHart #include "hbdll.ch" #include "Rmchart.ch" #include "DllxHb.ch" #include "cstruct.ch" #include "wintypes.ch" #include "RMChart2.ch" ****************************************************************************** * Sistema .....: BS.Escola * Programa ....: EjemBar.prg * Autor .......: Everton Battiston * Sintese .....: Fonte para gerar gráficos em BARRAS com o RMChart * Data ........: 7/9/2011 às 15:12:36 * Revisado em .: 7/9/2011 às 15:12:36 ****************************************************************************** PROCEDURE EjemBar(ccTitulo, ccTituloLateral, vValores, vLabels, vLegendas ) LOCAL cPath, nWleft, nWtop PUBLIC gcTitulo, gcTituloY, gaVals, gaXLabels, gnTipo, gnEstilo, gaLegSeries PUBLIC p_nTipo, p_nEstilo, IdG, IdG1, GlEtiqVals cPath := CurDrive()+":\"+CurDir() nWleft := 6 nWtop := 3 * gcTitulo := ccTitulo gcTituloY := ccTituloLateral gaVals := vValores gaXLabels := vLabels gnTipo := RMC_BARGROUP gnEstilo := RMC_BAR_FLAT gaLegSeries := vLegendas glEtiqVals := .f. IF YEAR(DATE()) < 2099 SET EPOCH TO (YEAR( DATE() ) - 80) ELSE SET EPOCH TO 2000 ENDIF SET DATE TO FRENCH hRmcDll := LoadLibrary( "RMCHART.DLL" ) SETHandle(hRmcDll) //Send hRmcDll to Rmc4xHb.prg SET _3DLOOK ON DEFINE BRUSH oBrush COLOR GetSysColor(15) DEFINE Dialog oDlg TITLE "Veesor Gráficos"; FROM 0, 0 TO 450, 730 pixel COLOR 0, 15591915 ACTIVATE Dialog oDlg ON INIT ( BuildMenu(oDlg), IdG:=gBarras( oDlg, gcTitulo, gcTituloY,; gaVals, gaXLabels, gnTipo, gnEstilo, gaLegSeries, glEtiqVals ) ) centered RETURN *---------------------------- FUNCTION BuildMenu() MENU oMenu MENUITEM "Tipo de Gráfico" ACTION nil; MESSAGE "Gráfico de Barras" MENU MENUITEM "Tipo de Barras" ACTION nil ; MESSAGE "Tipo de Barras" MENU MENUITEM "Barras Lado-a-Lado" ACTION TipoBarras( RMC_BARGROUP ) ; //RMC_BARGROUP MESSAGE "Gráfico de Barras Lado-a-Lado" MENUITEM "Barras Empilhadas" ACTION TipoBarras( RMC_BARSTACKED ) ; //RMC_BARSTACKED MESSAGE "Gráfico de Barras Empilhadas" ENDMENU MENUITEM "Orientação" ACTION nil ; MESSAGE "Orientação do Gráfico" MENU MENUITEM "Horizontal" ACTION EsHorizontal( .t. ) ; MESSAGE "Barras na Horizontal" MENUITEM "Vertical" ACTION EsHorizontal( .f. ) ; MESSAGE "Barras Vertical" ENDMENU MENUITEM "Estilo de Barras" ACTION nil ; // MESSAGE "Linhas" MENU MENUITEM "Barras Planas" ACTION EstiloBarras( RMC_BAR_FLAT ) ; MESSAGE "Gráfico de Barras Planas" MENUITEM "Barras Planas com Gradiente" ACTION EstiloBarras( RMC_BAR_FLAT_GRADIENT1 ) ; MESSAGE "Gráfico de Barras Planas com Gradiente" MENUITEM "Barras Planas com Gradiente Vertical" ACTION EstiloBarras( RMC_BAR_FLAT_GRADIENT2 ) ; MESSAGE "Gráfico de Barras Planas com Gradiente Vertical" MENUITEM "Barras 3D" ACTION EstiloBarras( RMC_BAR_3D ) ; MESSAGE "Gráfico de Barras 3D" MENUITEM "Barras 3D Gradiente" ACTION EstiloBarras( RMC_BAR_3D_GRADIENT ) ; MESSAGE "Gráfico de Barras 3D com Gradiente" MENUITEM "Colunas Gradiente" ACTION EstiloBarras( RMC_COLUMN_3D_GRADIENT ) ; MESSAGE "Gráfico de Colunas com Gradiente" ENDMENU ENDMENU MENUITEM "Ações" ; ACTION nil ; MESSAGE "Gráfico de Linhas" MENU MENUITEM "Guardar como Imagem" ACTION RMC_DRAW2FILE( IdG, "grafico.jpg",,, 100 ) ; MESSAGE "Guardar gráfico como arquivo JPG" MENUITEM "Enviar à Àrea de Transferência" ACTION RMC_DRAW2CLIPBOARD( IdG, P_nTipo ) ; MESSAGE "Enviar gráfico à Àrea de Transferência" MENUITEM "Imprimir" ACTION RMC_DRAW2PRINTER( IdG ) ; MESSAGE "Imprimir o gráfico" ENDMENU ENDMENU oDlg:SetMenu(oMenu) RETURN .t. FUNCTION EstiloBarras( nEst ) P_nEstilo := nEst FOR i=1 to Len( gaVals ) RMC_SetSeriesStyle( IdG, 1, i, P_nEstilo ) NEXT i RMC_DRAW( IdG ) RETURN nil FUNCTION TipoBarras( ntipo ) gnTipo:=ntipo gnEstilo := RMC_BAR_FLAT IdG := gBarras( oDlg, gcTitulo, gcTituloY, gaVals, gaXLabels, gnTipo, gnEstilo, gaLegSeries, glEtiqVals ) RETURN nil FUNCTION EsHorizontal( lh ) IdG := gBarras( oDlg, gcTitulo, gcTituloY, gaVals, gaXLabels, gnTipo, gnEstilo, gaLegSeries, glEtiqVals, lh ) return NIL Quote Link to comment Share on other sites More sharing options...
evertonlb Posted June 4, 2018 Report Share Posted June 4, 2018 /* nTipo (Tipos de Gráficas lineales soportados) -------------------------------------------------- #define RMC_LINE 21 #define RMC_AREA 22 nEstilo (Estilo de Gráficas de Lineas soportados) -------------------------------------------------- #define RMC_LINE_FLAT 21 #define RMC_LINE_FLAT_DOT 19 #define RMC_LINE_FLAT_DASH 18 #define RMC_LINE_CABLE 22 #define RMC_LINE_3D 23 #define RMC_LINE_3D_GRADIENT 24 #define RMC_AREA_FLAT 25 #define RMC_AREA_FLAT_GRADIENT_V 26 #define RMC_AREA_3D 29 #define RMC_AREA_3D_GRADIENT_V 30 nTipo (Tipos de Gráficos de Barra soportados) -------------------------------------------------- #define RMC_BARSINGLE 1 #define RMC_BARGROUP 2 #define RMC_BARSTACKED 3 #define RMC_BARSTACKED100 4 #define RMC_FLOATINGBAR 5 #define RMC_FLOATINGBARGROUP 6 nEstilo (Estilo de Gráficos de Barra soportados) -------------------------------------------------- #define RMC_BAR_FLAT 1 #define RMC_BAR_FLAT_GRADIENT1 2 #define RMC_BAR_FLAT_GRADIENT2 3 #define RMC_BAR_HOVER 4 #define RMC_COLUMN_FLAT 5 #define RMC_BAR_3D 6 #define RMC_BAR_3D_GRADIENT 7 #define RMC_COLUMN_3D 8 #define RMC_COLUMN_3D_GRADIENT 9 #define RMC_COLUMN_FLUTED 10 nEstilo ( Estilo de Gráficos Pastel soportados ) #define RMC_PIE_FLAT 51 #define RMC_PIE_GRADIENT 52 #define RMC_PIE_3D 53 #define RMC_PIE_3D_GRADIENT 54 #define RMC_DONUT_FLAT 55 #define RMC_DONUT_GRADIENT 56 #define RMC_DONUT_3D 57 #define RMC_DONUT_3D_GRADIENT 58 #define RMC_PYRAMIDE 59 #define RMC_PYRAMIDE3 60 // Alineación Pastel /Donut #define RMC_FULL 1 #define RMC_HALF_TOP 2 #define RMC_HALF_RIGHT 3 #define RMC_HALF_BOTTOM 4 #define RMC_HALF_LEFT 5 */ //------------------- STATIC CntValSeries //------------------- #include "FiveWin.ch" //Para RMCHart #include "hbdll.ch" #include "Rmchart.ch" // Look at this file to see keywords for 174 colors and #include "DllxHb.ch" // other constants. #include "cstruct.ch" #include "wintypes.ch" #include "RMChart2.ch" #define True 1 #define False 0 #define HH_DISPLAY_INDEX 2 #define CLR_RMCBLUE nRGB(99,148,236) // = "AliceBlue" #define CLR_RMCGOLD nRGB(248,208,0) // = "Gold" #define CLR_RMCBRONZE nRGB(221,204,163) // = "Metallic Bronze" #define TAB CHR(9) #command QUIT => ( PostQuitMessage( 0 ), __Quit() ) // suggested by Enrico //Fin para RMChart /*-------------------------------------------------------------------------------------------------------- FUNCION PARA GRAFICOS DE LINEAS Y AREAS SINTAXIS DE LA FUNCION GLINEAL: glineal( oWnd, cTit, cTitY, TituloY, aVals, aXLabels, nTipo, nEstilo, aLegSeries ) ventana, titulo superior, Titulo Eje Y, Valores de las series, etiquetas eje X, tipo de grafica lineal, estilo de la gráfica, Leyendas ----------------------------------------------------------------------------------------------------------*/ FUNCTION gLineal( oWnd, cTit, cTitY, aVals, aXLabels, nTipo, nEstilo, aLegSeries, lEtiqVals ) LOCAL i := 0, j:=0 LOCAL nRetVal := 0, sLabels := "" LOCAL oData IS DataStructD300 //20 LOCAL aColores, YminV, YmaxV aColores := { ColorDeepYellow, ColorBlue, ColorDarkBrown, ColorDeepRose, ColorCoral } CntValSeries := If( Len( aXLabels )>20, 20, Len( aXLabels ) ) YminV := 0 YmaxV := AMaxElement( aVals ) + AMaxElement( aVals ) / 10 ID_RMC1 := 100 IF lEtiqVals EtiqVals:=RMC_VLABEL_DEFAULT ELSE EtiqVals:=RMC_VLABEL_NONE ENDIF //Paso a variables públicas P_nTipo := nTipo P_nEstilo := nEstilo //************** Creo la gráfica ********************** nRetVal = RMC_CreateChart( ; oWnd:hWnd , ; // nParentHandle ID_RMC1 , ; // nCtrlID 0 , ; // nTop 0 , ; // nLeft WndWidth(oWnd:hWnd) -22 , ; // nWidth WndHeight(oWnd:hWnd) -80 , ; // nHeight ColorAliceBlue , ; // nBackColor RMC_CTRLSTYLEFLAT , ; // nCtrlStyle False , ; // nExportOnly "paper.jpg" , ; // sBgImage "Tahoma" , ; // sFontName 0 , ; // nToolTipwidth 0 ; // nBitmapBKColor ) If nRetVal < 0 ; IsError(1) ; RETURN nil ; EndIf //************** Agrego Región ***************************** nRetVal = RMC_AddRegion( ; ID_RMC1 , ; // nCtrlID 5 , ; // nLeft 5 , ; // nTop -5 , ; // nWidth -6 , ; // nHeight "Logos - Avaliação do Desenvolvimento Escolar - V 0.90", ; // sFooter False ; // nShowBorder ) If nRetVal < 0 ; IsError(2) ; RETURN nil ; EndIf //************** Titulo de la Región ******************* nRetVal = RMC_AddCaption( ; ID_RMC1 , ; // nCtrlID 1 , ; // nRegion cTit , ; // sCaption este es el titulo del gráfico. ColorAquamarine , ; // nBackColor ColorBlack , ; // nTextColor 10 , ; // nFontSize True ; // nIsBold ) If nRetVal < 0 ; IsError(3) ; RETURN nil ; EndIf //************** Grilla de la Región ***************************** nRetVal = RMC_AddGrid( ; ID_RMC1 , ; // nCtrlID 1 , ; // nRegion ColorBabyBlue , ; // nGridBackColor ColorBlack ColorBeige False , ; // nAsGradient 0 , ; // nLeft 0 , ; // nTop 0 , ; // nWidth 0 , ; // nHeight RMC_BICOLOR_LABELAXIS ; // nBiColor ) If nRetVal < 0 ; IsError(4) ; RETURN nil ; EndIf //********** Rango de valores Y a Región (min max)****************** nRetVal = RMC_AddDataAxis( ; ID_RMC1 , ; // nCtrlID 1 , ; // nRegion RMC_DATAAXISLEFT , ; // nAlignment 0.0 , ; // nMinValue -DOUBLE so MUST have decimal!! YmaxV , ; // nMaxValue -DOUBLE so MUST have decimal!! CntValSeries , ; // nTickCount 8 , ; // nFontsize ColorBlack , ; // nTextColor ColorBlack , ; // nLineColor RMC_LINESTYLESOLID , ; // nLinestyle 0 , ; // nDecimalDigits "" , ; // sUnit cTitY , ; // sText "" , ; // sLabels RMC_TEXTCENTER ; // nLabelAlignment ) If nRetVal < 0 ; IsError(5) ; RETURN nil ; EndIf //*********************** Leyendas de datos *************** sLegend:= "" FOR i = 1 to Len( aLegSeries ) sLegend += ( aLegSeries[i] + "*" ) NEXT nRetVal = RMC_AddLegend( ; ID_RMC1 , ; // nCtrlID 1 , ; // nRegion sLegend , ; // sLegend RMC_LEGEND_CUSTOM_TOP, ; // nLegendAlign ColorAliceBlue , ; // nLegendBackColor RMC_LEGENDRECT , ; // nLegendStyle ColorCoral , ; // nLegendTextColor ColorDarkBlue 8 , ; // nLegendFoltSize False ; // nLegendIsBold ) If nRetVal < 0 ; IsError(6) ; RETURN nil ; EndIf //***********************Agrego etiquetas a eje X *************** sLabels := "" FOR i=1 to CntValSeries sLabels+= aXLabels[i] + "*" next nRetVal = RMC_AddLabelAxis( ; ID_RMC1 , ; // nCtrlID 1 , ; // nRegion sLabels , ; // sLabels (separated by asterisk) 1 , ; // nCount CntValSeries , ; // ntickCount //cantidad de etiquetas ojo!! RMC_LABELAXISBOTTOM , ; // nAlignment 8 , ; // nFontSize ColorBlack , ; // ntextColor RMC_TEXTCENTER , ; // nTextAlignment ColorBlack , ; // nLineColor RMC_LINESTYLENONE , ; // nLineStyle "" ; // sText ) If nRetVal < 0 ; IsError(7) ; RETURN nil ; EndIf //************** Agrego Series a la Región ******************************* //****** Transfiero los datos a través de variables de gráfica************ FOR j=1 to Len( aVals ) FOR i=1 to CntValSeries //se fuerza un maximo de 20 valores por serie. oData:nDouble[i] := aVals[j,i] NEXT i nRetVal = RMC_AddLineSeries( ; ID_RMC1 , ; // nCtrlID 1 , ; // nRegion oData[1] , ; // nFirstDataValue CntValSeries , ; // nDataValuesCount 0 , ; // nFirstPPCValue 0 , ; // nPPCValuesCount nTipo , ; // nType RMC_LINE_3D_GRADIENT , ; // nStyle nEstilo , ; // nLineStyle False , ; // nIsLucent aColores[j] , ; // nColor RMC_SYMBOL_POINT , ; // nSymbol 1 , ; // nWhichDataAxis EtiqVals , ; // nValueLabelOn RMC_HATCHBRUSH_OFF ; // nHatchMode ) NEXT j nRetVal = RMC_Draw( ID_RMC1 ) If nRetVal < 0 ; IsError(8) ; RETURN nil ; EndIf RETURN ID_RMC1 /* *------------------------------------------------------------------------------------------------- * * FUNCION PARA GRAFICOS DE BARRAS * SINTAXIS DE LA FUNCION GLINEAL: * * gBarras( oWnd, cTit, cTitY, TituloY, aVals, aXLabels, nTipo, nEstilo, aLegSeries, lh ) * ventana, titulo superior, Titulo Eje Y, Valores de las series, * etiquetas eje X, tipo de grafica lineal, estilo de la gráfica, Leyendas , orientación horizontal *------------------------------------------------------------------------------------------------- **/ FUNCTION gBarras( oWnd, cTit, cTitY, aVals, aXLabels, nTipo, nEstilo, aLegSeries, lEtiqVals, lh ) LOCAL i := 0, j:=0 LOCAL nRetVal := 0, sLabels := "" LOCAL oData IS DataStructD300 //20 LOCAL aColores, YminV, YmaxV DEFAULT lh := .f. aColores := { ColorBlue, ColorGreen, ColorRed, ColorDeepYellow, ColorDarkBrown, ColorDeepRose, ColorCoral, ColorBrown } CntValSeries := If( Len( aXLabels )>20, 20, Len( aXLabels ) ) YminV := 0 YmaxV := AMaxElement( aVals ) + AMaxElement( aVals ) / 10 ID_RMC1 := 100 IF lEtiqVals EtiqVals:=RMC_VLABEL_DEFAULT ELSE EtiqVals:=RMC_VLABEL_NONE ENDIF IF lh Alineac := RMC_DATAAXISBOTTOM LegAlineac := RMC_LEGEND_CUSTOM_RIGHT labAlineac := RMC_LABELAXISLEFT ELSE Alineac := RMC_DATAAXISLEFT LegAlineac := RMC_LEGEND_CUSTOM_TOP labAlineac := RMC_LABELAXISBOTTOM ENDIF //Paso a variables públicas P_nTipo := nTipo P_nEstilo := nEstilo //************** Creo la gráfica ********************** nRetVal = RMC_CreateChart( ; oWnd:hWnd , ; // nParentHandle ID_RMC1 , ; // nCtrlID 0 , ; // nTop 0 , ; // nLeft WndWidth(oWnd:hWnd) -22 , ; // nWidth WndHeight(oWnd:hWnd) -86 , ; // nHeight ColorAzure , ; // nBackColor RMC_CTRLSTYLEFLAT , ; // nCtrlStyle False , ; // nExportOnly "paper.jpg" , ; // sBgImage "" , ; // sFontName 20 , ; // nToolTipwidth 0 ; // nBitmapBKColor ) If nRetVal < 0 ; IsError(9) ; RETURN nil ; EndIf //************** Agregar Región ***************************** nRetVal = RMC_AddRegion( ; ID_RMC1 , ; // nCtrlID 5 , ; // nLeft 5 , ; // nTop -5 , ; // nWidth -6 , ; // nHeight "Veesor - Automação Comercial - V. 0.8.A", ; // sFooter False ; // nShowBorder ) If nRetVal < 0 ; IsError(10) ; RETURN nil ; EndIf //************** Agregar titulo Región ******************* nRetVal = RMC_AddCaption( ; ID_RMC1 , ; // nCtrlID 1 , ; // nRegion cTit , ; // sCaption ColorAquamarine , ; // nBackColor ColorBlack , ; // nTextColor 10 , ; // nFontSize True ; // nIsBold ) If nRetVal < 0 ; IsError(11) ; RETURN nil ; EndIf //************** Grilla de la Región 1 ***************************** nRetVal = RMC_AddGrid( ; ID_RMC1 , ; // nCtrlID 1 , ; // nRegion ColorBeige , ; // nGridBackColor False , ; // nAsGradient 0 , ; // nLeft 0 , ; // nTop 0 , ; // nWidth 0 , ; // nHeight RMC_BICOLOR_LABELAXIS ; // nBiColor ) If nRetVal < 0 ; IsError(12) ; RETURN nil ; EndIf //********** Rango de valores Y a Región (min max)****************** nRetVal = RMC_AddDataAxis( ; ID_RMC1 , ; // nCtrlID 1 , ; // nRegion Alineac , ; // nAlignment 0.0 , ; // nMinValue -DOUBLE so MUST have decimal!! YmaxV , ; // nMaxValue -DOUBLE so MUST have decimal!! CntValSeries , ; // nTickCount 8 , ; // nFontsize ColorBlack , ; // nTextColor ColorBlack , ; // nLineColor RMC_LINESTYLESOLID , ; // nLinestyle 0 , ; // nDecimalDigits "" , ; // sUnit cTitY , ; // sText "" , ; // sLabels RMC_TEXTCENTER ; // nLabelAlignment ) If nRetVal < 0 ; IsError(13) ; RETURN nil ; EndIf //*********************** Leyenda de datos *************** sLegend:= "" FOR i = 1 to Len( aLegSeries ) sLegend += ( aLegSeries[i] + "*" ) NEXT nRetVal = RMC_AddLegend( ; ID_RMC1 , ; // nCtrlID 1 , ; // nRegion sLegend , ; // sLegend LegAlineac , ; // nLegendAlign ColorAliceBlue , ; // nLegendBackColor RMC_LEGENDRECT , ; // nLegendStyle ColorDarkBlue , ; // nLegendTextColor 8 , ; // nLegendFoltSize False ; // nLegendIsBold ) If nRetVal < 0 ; IsError(14) ; RETURN nil ; EndIf /* // Establece Rojo para la tercer barra: nRetVal = RMC_SetSeriesColor( ; ID_RMC1 , ; // nCtrlID 1 , ; // nRegion 1 , ; // nSeries ColorRed , ; // nColor 3 ; // nIndex - bar # to get color ) */ //************** Agregar etiquetas de eje X ***************************** sLabels = "" FOR i=1 to CntValSeries sLabels+= aXLabels[i] + "*" next nRetVal = RMC_AddLabelAxis( ; ID_RMC1 , ; // nCtrlID 1 , ; // nRegion sLabels , ; // sLabels (separated by asterisk) 1 , ; // nCount CntValSeries , ; // ntickCount RMC_LABELAXISBOTTOM , ; // nAlignment 8 , ; // nFontSize ColorBlack , ; // ntextColor RMC_TEXTCENTER , ; // nTextAlignment ColorBlack , ; // nLineColor RMC_LINESTYLENONE , ; // nLineStyle "" ; // sText ) If nRetVal < 0 ; IsError(15) ; RETURN nil ; EndIf //************** Agregar Series a Región ******************************* //****** Transfiero los datos a través de variables de gráfica************ FOR j=1 to Len(aVals) FOR i=1 to CntValSeries oData:nDouble[i] := aVals[j,i] NEXT i nRetVal = RMC_AddBarSeries( ; ID_RMC1 , ; // nCtrlID 1 , ; // nRegion oData[1] , ; // nFirstDataValue CntValSeries , ; // nDataValuesCount nTipo , ; // nType RMC_COLUMN_3D_GRADIENT , ; // nEstilo nStyle False , ; // nIsLucent aColores[j] , ; // nColor lh , ; // nIsHorizontal 1 , ; // nWhichAxis EtiqVals , ; // nValuelabelOn 1 , ; // nPointsPerColumn RMC_HATCHBRUSH_OFF ; // nHatchMode ) //RMC_VLABEL_DEFAULT pone etiquetas de valores RMC_VLABEL_NONE no. NEXT j nRetVal = RMC_Draw( ID_RMC1 ) If nRetVal < 0 IsError(16) RETURN nil EndIf RETURN ID_RMC1 FUNCTION IsError(nError) DEFAULT nError := 0 MsgAlert( "Ocorreu um erro em: "+LTRIM(STR(nError)) +CRLF+; "Por Favor, anote este código." ) // Each error number can be traced to a specific place in this prg. RETURN nil *---------------------------- FUNCTION AMaxElement( aArray ) LOCAL i, j, aProv:={}, nmax:=0.0, ntot:=0.0 IF gnTipo = RMC_BARSTACKED FOR i= 1 to CntValSeries FOR j= 1 to Len( aArray ) ntot+=aArray[j,i] NEXT j If nmax < ntot nmax:=ntot ENDIF ntot:=0.0 NEXT i ELSE FOR j= 1 to Len( aArray ) FOR i=1 to CntValSeries //limito a 20 por si pasan mas. If nmax < aArray[j,i] nmax:=aArray[j,i] ENDIF NEXT i NEXT j ENDIF RETURN nmax /* ------------------------------------------------------------------------------------------------------------- Generación de Gráficos Pastel FUNCION gPastel() ------------------------------------------------------------------------------------------------------------- */ FUNCTION gPastel( oWnd, cTit, nEstilo, nAlign, aVals, aLegend, nCor_Gr ) LOCAL nRetVal := 0 LOCAL sLegend := "" LOCAL oColor IS ColorStructL5 LOCAL oData IS DataStructD20 //************** Create the chart ********************** nRetVal = RMC_CreateChart( ; oWnd:hWnd , ; // nParentHandle ID_RMC1 , ; // nCtrlID 0 , ; // nTop 0 , ; // nLeft WndHeight(oWnd:hWnd) -86 , ; // nWidth WndHeight(oWnd:hWnd) -86 , ; // nHeight ColorTransparent , ; // nBackColor RMC_CTRLSTYLEIMAGETILED , ; // nCtrlStyle False , ; // nExportOnly "imagens\BaloesGde.JPG" , ; // sBgImage //"paper.jpg" "" , ; // sFontName 0 , ; // nToolTipwidth 0 ; // nBitmapBKColor ) If nRetVal < 0 ; IsError(1) ; RETURN nil ; EndIf //************** Add Region 1 ***************************** nRetVal = RMC_AddRegion( ; ID_RMC1 , ; // nCtrlID 5 , ; // nLeft 5 , ; // nTop -5 , ; // nWidth -6 , ; // nHeight "Veesor - Automação Comercial - V. 1.37D", ; // sFooter False ; // nShowBorder ) If nRetVal < 0 ; IsError(2) ; RETURN nil ; EndIf //************** Add legend to region 1 ******************************* sLegend = "" FOR i= 1 to Len( aLegend ) sLegend += ( aLegend[i] + "*" ) NEXT i nRetVal = RMC_AddLegend( ; ID_RMC1 , ; // nCtrlID 1 , ; // nRegion sLegend , ; // sLegend RMC_LEGEND_ONVLABELS, ; // nLegendAlign ColorGainsboro , ; // nLegendBackColor RMC_LEGENDNORECT , ; // nLegendStyle ColorBlue , ; // nLegendTextColor 8 , ; // nLegendFoltSize False ; // nLegendIsBold ) If nRetVal < 0 ; IsError(3) ; RETURN nil ; EndIf //************** Add Series 1 to region 1 ******************************* //****** Read color values ****** if nCor_Gr == 2 // bom.. o que eu fiz foi o seguinte // Ao gerar os graficos do PsicoMotor ele acabava tendo as mesmas // cores do Socio Afetivo, ai ficava muito confuso. Entao eu coloquei um // outro parametro na chamada do GPastel2. coloquei um numero no final // ai consigo trocar as cores sem problema.. // oColor:nLong[1] := ColorMediumVioletRed oColor:nLong[2] := ColorOrange oColor:nLong[3] := ColorIndigo oColor:nLong[4] := ColorBlue // Your data goes colors into these 5 slots oColor:nLong[5] := ColorDeepRose else oColor:nLong[1] := ColorDeepYellow oColor:nLong[2] := ColorRed oColor:nLong[3] := ColorGreen oColor:nLong[4] := ColorBlue // Your data goes colors into these 5 slots oColor:nLong[5] := ColorDeepRose endif //****** Read data values ****** FOR i = 1 to Len( aVals) oData:nDouble[i] := aVals[i] NEXT i nRetVal = RMC_AddGridlessSeries( ; ID_RMC1 , ; // nCtrlID 1 , ; // nRegion oData[1] , ; // nFirstDataValue Len( aVals ) , ; // nDataValuesCount oColor[1] , ; // nFirstColorValue 5 , ; // ncolorValuesCount nEstilo , ; // nStyle RMC_PIE_GRADIENT RMC_DONUT_GRADIENT RMC_PYRAMIDE RMC_PYRAMIDE3 RMC_PIE_3D_GRADIENT RMC_PIE_3D nAlign , ; // nAlignment 0 , ; // nExplodemode False , ; // nIsLucent RMC_VLABEL_TWIN , ; // nValueLabelOn RMC_HATCHBRUSH_OFF , ; // nHatchMode 0 ; // nStartAngle ) If nRetVal < 0 ; IsError(4) ; RETURN nil ; EndIf nRetVal = RMC_COText( ; ID_RMC1 , ; // nCtrlID 1 , ; // nCOIndex cTit , ; // sText 70 , ; // nLeft 20 , ; // nTop 300 , ; // nWidth (optional, as are the following...) 250 , ; // nHeight RMC_BOX_NONE , ; // nStyle 0 , ; // nBGColor 0 , ; // nLineColor 0 , ; // nTransparency 0 , ; // nLineAlignment ColorBlack , ; // nTextColor "10C" ; // sTextProperties ) If nRetVal < 0 ; IsError(5) ; RETURN nil ; EndIf //-------------------------------------------------- nRetVal = RMC_Draw( ID_RMC1 ) If nRetVal < 0 ; IsError(6) ; RETURN nil ; EndIf RETURN ID_RMC1 //---------------------------- RMC4XHB.PRG EjemLin.prg EjemBar.prg EjemPastel.prg RMCHART.CH RMCHART2.CH rmchartx.ch kapiaba 1 Quote Link to comment Share on other sites More sharing options...
Jmsilva Posted June 4, 2018 Report Share Posted June 4, 2018 Veja o exemplo FW, \FWH\samples\winpop4.prg, se ajuda. Quote Link to comment Share on other sites More sharing options...
twl Posted March 24, 2021 Report Share Posted March 24, 2021 Em 11/05/2018 at 15:21, Luiz Fernando disse: a uns 7 anos atras estava com um projeto de hotel, tinha criado o layout toda logica, mais devido a região que estou acabou não sendo viavel continuar, acredito que vc possa aproveitar a mesma logica para mesa, vou disponibilizar o projeto para quem queira tocar ele em frente. https://uploaddeimagens.com.br/imagens/five_1-png https://uploaddeimagens.com.br/imagens/five_2-png https://uploaddeimagens.com.br/imagens/five_3-png segue projeto(apenas defini o layout, a ideia seria algo interativo, aonde apenas de olhar para tela, o usuario iria saber se chave esta no apartamento, se ja tomou cafe, se a faxina foi realizada, tudo usando monitor touch, por isto este visual) https://www.sendspace.com/file/qmju2r os arquivos .ch estão vazio, Em 03/06/2018 at 21:58, evertonlb disse: /* nTipo (Tipos de Gráficas lineales soportados) -------------------------------------------------- #define RMC_LINE 21 #define RMC_AREA 22 nEstilo (Estilo de Gráficas de Lineas soportados) -------------------------------------------------- #define RMC_LINE_FLAT 21 #define RMC_LINE_FLAT_DOT 19 #define RMC_LINE_FLAT_DASH 18 #define RMC_LINE_CABLE 22 #define RMC_LINE_3D 23 #define RMC_LINE_3D_GRADIENT 24 #define RMC_AREA_FLAT 25 #define RMC_AREA_FLAT_GRADIENT_V 26 #define RMC_AREA_3D 29 #define RMC_AREA_3D_GRADIENT_V 30 nTipo (Tipos de Gráficos de Barra soportados) -------------------------------------------------- #define RMC_BARSINGLE 1 #define RMC_BARGROUP 2 #define RMC_BARSTACKED 3 #define RMC_BARSTACKED100 4 #define RMC_FLOATINGBAR 5 #define RMC_FLOATINGBARGROUP 6 nEstilo (Estilo de Gráficos de Barra soportados) -------------------------------------------------- #define RMC_BAR_FLAT 1 #define RMC_BAR_FLAT_GRADIENT1 2 #define RMC_BAR_FLAT_GRADIENT2 3 #define RMC_BAR_HOVER 4 #define RMC_COLUMN_FLAT 5 #define RMC_BAR_3D 6 #define RMC_BAR_3D_GRADIENT 7 #define RMC_COLUMN_3D 8 #define RMC_COLUMN_3D_GRADIENT 9 #define RMC_COLUMN_FLUTED 10 nEstilo ( Estilo de Gráficos Pastel soportados ) #define RMC_PIE_FLAT 51 #define RMC_PIE_GRADIENT 52 #define RMC_PIE_3D 53 #define RMC_PIE_3D_GRADIENT 54 #define RMC_DONUT_FLAT 55 #define RMC_DONUT_GRADIENT 56 #define RMC_DONUT_3D 57 #define RMC_DONUT_3D_GRADIENT 58 #define RMC_PYRAMIDE 59 #define RMC_PYRAMIDE3 60 // Alineación Pastel /Donut #define RMC_FULL 1 #define RMC_HALF_TOP 2 #define RMC_HALF_RIGHT 3 #define RMC_HALF_BOTTOM 4 #define RMC_HALF_LEFT 5 */ //------------------- STATIC CntValSeries //------------------- #include "FiveWin.ch" //Para RMCHart #include "hbdll.ch" #include "Rmchart.ch" // Look at this file to see keywords for 174 colors and #include "DllxHb.ch" // other constants. #include "cstruct.ch" #include "wintypes.ch" #include "RMChart2.ch" #define True 1 #define False 0 #define HH_DISPLAY_INDEX 2 #define CLR_RMCBLUE nRGB(99,148,236) // = "AliceBlue" #define CLR_RMCGOLD nRGB(248,208,0) // = "Gold" #define CLR_RMCBRONZE nRGB(221,204,163) // = "Metallic Bronze" #define TAB CHR(9) #command QUIT => ( PostQuitMessage( 0 ), __Quit() ) // suggested by Enrico //Fin para RMChart /*-------------------------------------------------------------------------------------------------------- FUNCION PARA GRAFICOS DE LINEAS Y AREAS SINTAXIS DE LA FUNCION GLINEAL: glineal( oWnd, cTit, cTitY, TituloY, aVals, aXLabels, nTipo, nEstilo, aLegSeries ) ventana, titulo superior, Titulo Eje Y, Valores de las series, etiquetas eje X, tipo de grafica lineal, estilo de la gráfica, Leyendas ----------------------------------------------------------------------------------------------------------*/ FUNCTION gLineal( oWnd, cTit, cTitY, aVals, aXLabels, nTipo, nEstilo, aLegSeries, lEtiqVals ) LOCAL i := 0, j:=0 LOCAL nRetVal := 0, sLabels := "" LOCAL oData IS DataStructD300 //20 LOCAL aColores, YminV, YmaxV aColores := { ColorDeepYellow, ColorBlue, ColorDarkBrown, ColorDeepRose, ColorCoral } CntValSeries := If( Len( aXLabels )>20, 20, Len( aXLabels ) ) YminV := 0 YmaxV := AMaxElement( aVals ) + AMaxElement( aVals ) / 10 ID_RMC1 := 100 IF lEtiqVals EtiqVals:=RMC_VLABEL_DEFAULT ELSE EtiqVals:=RMC_VLABEL_NONE ENDIF //Paso a variables públicas P_nTipo := nTipo P_nEstilo := nEstilo //************** Creo la gráfica ********************** nRetVal = RMC_CreateChart( ; oWnd:hWnd , ; // nParentHandle ID_RMC1 , ; // nCtrlID 0 , ; // nTop 0 , ; // nLeft WndWidth(oWnd:hWnd) -22 , ; // nWidth WndHeight(oWnd:hWnd) -80 , ; // nHeight ColorAliceBlue , ; // nBackColor RMC_CTRLSTYLEFLAT , ; // nCtrlStyle False , ; // nExportOnly "paper.jpg" , ; // sBgImage "Tahoma" , ; // sFontName 0 , ; // nToolTipwidth 0 ; // nBitmapBKColor ) If nRetVal < 0 ; IsError(1) ; RETURN nil ; EndIf //************** Agrego Región ***************************** nRetVal = RMC_AddRegion( ; ID_RMC1 , ; // nCtrlID 5 , ; // nLeft 5 , ; // nTop -5 , ; // nWidth -6 , ; // nHeight "Logos - Avaliação do Desenvolvimento Escolar - V 0.90", ; // sFooter False ; // nShowBorder ) If nRetVal < 0 ; IsError(2) ; RETURN nil ; EndIf //************** Titulo de la Región ******************* nRetVal = RMC_AddCaption( ; ID_RMC1 , ; // nCtrlID 1 , ; // nRegion cTit , ; // sCaption este es el titulo del gráfico. ColorAquamarine , ; // nBackColor ColorBlack , ; // nTextColor 10 , ; // nFontSize True ; // nIsBold ) If nRetVal < 0 ; IsError(3) ; RETURN nil ; EndIf //************** Grilla de la Región ***************************** nRetVal = RMC_AddGrid( ; ID_RMC1 , ; // nCtrlID 1 , ; // nRegion ColorBabyBlue , ; // nGridBackColor ColorBlack ColorBeige False , ; // nAsGradient 0 , ; // nLeft 0 , ; // nTop 0 , ; // nWidth 0 , ; // nHeight RMC_BICOLOR_LABELAXIS ; // nBiColor ) If nRetVal < 0 ; IsError(4) ; RETURN nil ; EndIf //********** Rango de valores Y a Región (min max)****************** nRetVal = RMC_AddDataAxis( ; ID_RMC1 , ; // nCtrlID 1 , ; // nRegion RMC_DATAAXISLEFT , ; // nAlignment 0.0 , ; // nMinValue -DOUBLE so MUST have decimal!! YmaxV , ; // nMaxValue -DOUBLE so MUST have decimal!! CntValSeries , ; // nTickCount 8 , ; // nFontsize ColorBlack , ; // nTextColor ColorBlack , ; // nLineColor RMC_LINESTYLESOLID , ; // nLinestyle 0 , ; // nDecimalDigits "" , ; // sUnit cTitY , ; // sText "" , ; // sLabels RMC_TEXTCENTER ; // nLabelAlignment ) If nRetVal < 0 ; IsError(5) ; RETURN nil ; EndIf //*********************** Leyendas de datos *************** sLegend:= "" FOR i = 1 to Len( aLegSeries ) sLegend += ( aLegSeries[i] + "*" ) NEXT nRetVal = RMC_AddLegend( ; ID_RMC1 , ; // nCtrlID 1 , ; // nRegion sLegend , ; // sLegend RMC_LEGEND_CUSTOM_TOP, ; // nLegendAlign ColorAliceBlue , ; // nLegendBackColor RMC_LEGENDRECT , ; // nLegendStyle ColorCoral , ; // nLegendTextColor ColorDarkBlue 8 , ; // nLegendFoltSize False ; // nLegendIsBold ) If nRetVal < 0 ; IsError(6) ; RETURN nil ; EndIf //***********************Agrego etiquetas a eje X *************** sLabels := "" FOR i=1 to CntValSeries sLabels+= aXLabels[i] + "*" next nRetVal = RMC_AddLabelAxis( ; ID_RMC1 , ; // nCtrlID 1 , ; // nRegion sLabels , ; // sLabels (separated by asterisk) 1 , ; // nCount CntValSeries , ; // ntickCount //cantidad de etiquetas ojo!! RMC_LABELAXISBOTTOM , ; // nAlignment 8 , ; // nFontSize ColorBlack , ; // ntextColor RMC_TEXTCENTER , ; // nTextAlignment ColorBlack , ; // nLineColor RMC_LINESTYLENONE , ; // nLineStyle "" ; // sText ) If nRetVal < 0 ; IsError(7) ; RETURN nil ; EndIf //************** Agrego Series a la Región ******************************* //****** Transfiero los datos a través de variables de gráfica************ FOR j=1 to Len( aVals ) FOR i=1 to CntValSeries //se fuerza un maximo de 20 valores por serie. oData:nDouble[i] := aVals[j,i] NEXT i nRetVal = RMC_AddLineSeries( ; ID_RMC1 , ; // nCtrlID 1 , ; // nRegion oData[1] , ; // nFirstDataValue CntValSeries , ; // nDataValuesCount 0 , ; // nFirstPPCValue 0 , ; // nPPCValuesCount nTipo , ; // nType RMC_LINE_3D_GRADIENT , ; // nStyle nEstilo , ; // nLineStyle False , ; // nIsLucent aColores[j] , ; // nColor RMC_SYMBOL_POINT , ; // nSymbol 1 , ; // nWhichDataAxis EtiqVals , ; // nValueLabelOn RMC_HATCHBRUSH_OFF ; // nHatchMode ) NEXT j nRetVal = RMC_Draw( ID_RMC1 ) If nRetVal < 0 ; IsError(8) ; RETURN nil ; EndIf RETURN ID_RMC1 /* *------------------------------------------------------------------------------------------------- * * FUNCION PARA GRAFICOS DE BARRAS * SINTAXIS DE LA FUNCION GLINEAL: * * gBarras( oWnd, cTit, cTitY, TituloY, aVals, aXLabels, nTipo, nEstilo, aLegSeries, lh ) * ventana, titulo superior, Titulo Eje Y, Valores de las series, * etiquetas eje X, tipo de grafica lineal, estilo de la gráfica, Leyendas , orientación horizontal *------------------------------------------------------------------------------------------------- **/ FUNCTION gBarras( oWnd, cTit, cTitY, aVals, aXLabels, nTipo, nEstilo, aLegSeries, lEtiqVals, lh ) LOCAL i := 0, j:=0 LOCAL nRetVal := 0, sLabels := "" LOCAL oData IS DataStructD300 //20 LOCAL aColores, YminV, YmaxV DEFAULT lh := .f. aColores := { ColorBlue, ColorGreen, ColorRed, ColorDeepYellow, ColorDarkBrown, ColorDeepRose, ColorCoral, ColorBrown } CntValSeries := If( Len( aXLabels )>20, 20, Len( aXLabels ) ) YminV := 0 YmaxV := AMaxElement( aVals ) + AMaxElement( aVals ) / 10 ID_RMC1 := 100 IF lEtiqVals EtiqVals:=RMC_VLABEL_DEFAULT ELSE EtiqVals:=RMC_VLABEL_NONE ENDIF IF lh Alineac := RMC_DATAAXISBOTTOM LegAlineac := RMC_LEGEND_CUSTOM_RIGHT labAlineac := RMC_LABELAXISLEFT ELSE Alineac := RMC_DATAAXISLEFT LegAlineac := RMC_LEGEND_CUSTOM_TOP labAlineac := RMC_LABELAXISBOTTOM ENDIF //Paso a variables públicas P_nTipo := nTipo P_nEstilo := nEstilo //************** Creo la gráfica ********************** nRetVal = RMC_CreateChart( ; oWnd:hWnd , ; // nParentHandle ID_RMC1 , ; // nCtrlID 0 , ; // nTop 0 , ; // nLeft WndWidth(oWnd:hWnd) -22 , ; // nWidth WndHeight(oWnd:hWnd) -86 , ; // nHeight ColorAzure , ; // nBackColor RMC_CTRLSTYLEFLAT , ; // nCtrlStyle False , ; // nExportOnly "paper.jpg" , ; // sBgImage "" , ; // sFontName 20 , ; // nToolTipwidth 0 ; // nBitmapBKColor ) If nRetVal < 0 ; IsError(9) ; RETURN nil ; EndIf //************** Agregar Región ***************************** nRetVal = RMC_AddRegion( ; ID_RMC1 , ; // nCtrlID 5 , ; // nLeft 5 , ; // nTop -5 , ; // nWidth -6 , ; // nHeight "Veesor - Automação Comercial - V. 0.8.A", ; // sFooter False ; // nShowBorder ) If nRetVal < 0 ; IsError(10) ; RETURN nil ; EndIf //************** Agregar titulo Región ******************* nRetVal = RMC_AddCaption( ; ID_RMC1 , ; // nCtrlID 1 , ; // nRegion cTit , ; // sCaption ColorAquamarine , ; // nBackColor ColorBlack , ; // nTextColor 10 , ; // nFontSize True ; // nIsBold ) If nRetVal < 0 ; IsError(11) ; RETURN nil ; EndIf //************** Grilla de la Región 1 ***************************** nRetVal = RMC_AddGrid( ; ID_RMC1 , ; // nCtrlID 1 , ; // nRegion ColorBeige , ; // nGridBackColor False , ; // nAsGradient 0 , ; // nLeft 0 , ; // nTop 0 , ; // nWidth 0 , ; // nHeight RMC_BICOLOR_LABELAXIS ; // nBiColor ) If nRetVal < 0 ; IsError(12) ; RETURN nil ; EndIf //********** Rango de valores Y a Región (min max)****************** nRetVal = RMC_AddDataAxis( ; ID_RMC1 , ; // nCtrlID 1 , ; // nRegion Alineac , ; // nAlignment 0.0 , ; // nMinValue -DOUBLE so MUST have decimal!! YmaxV , ; // nMaxValue -DOUBLE so MUST have decimal!! CntValSeries , ; // nTickCount 8 , ; // nFontsize ColorBlack , ; // nTextColor ColorBlack , ; // nLineColor RMC_LINESTYLESOLID , ; // nLinestyle 0 , ; // nDecimalDigits "" , ; // sUnit cTitY , ; // sText "" , ; // sLabels RMC_TEXTCENTER ; // nLabelAlignment ) If nRetVal < 0 ; IsError(13) ; RETURN nil ; EndIf //*********************** Leyenda de datos *************** sLegend:= "" FOR i = 1 to Len( aLegSeries ) sLegend += ( aLegSeries[i] + "*" ) NEXT nRetVal = RMC_AddLegend( ; ID_RMC1 , ; // nCtrlID 1 , ; // nRegion sLegend , ; // sLegend LegAlineac , ; // nLegendAlign ColorAliceBlue , ; // nLegendBackColor RMC_LEGENDRECT , ; // nLegendStyle ColorDarkBlue , ; // nLegendTextColor 8 , ; // nLegendFoltSize False ; // nLegendIsBold ) If nRetVal < 0 ; IsError(14) ; RETURN nil ; EndIf /* // Establece Rojo para la tercer barra: nRetVal = RMC_SetSeriesColor( ; ID_RMC1 , ; // nCtrlID 1 , ; // nRegion 1 , ; // nSeries ColorRed , ; // nColor 3 ; // nIndex - bar # to get color ) */ //************** Agregar etiquetas de eje X ***************************** sLabels = "" FOR i=1 to CntValSeries sLabels+= aXLabels[i] + "*" next nRetVal = RMC_AddLabelAxis( ; ID_RMC1 , ; // nCtrlID 1 , ; // nRegion sLabels , ; // sLabels (separated by asterisk) 1 , ; // nCount CntValSeries , ; // ntickCount RMC_LABELAXISBOTTOM , ; // nAlignment 8 , ; // nFontSize ColorBlack , ; // ntextColor RMC_TEXTCENTER , ; // nTextAlignment ColorBlack , ; // nLineColor RMC_LINESTYLENONE , ; // nLineStyle "" ; // sText ) If nRetVal < 0 ; IsError(15) ; RETURN nil ; EndIf //************** Agregar Series a Región ******************************* //****** Transfiero los datos a través de variables de gráfica************ FOR j=1 to Len(aVals) FOR i=1 to CntValSeries oData:nDouble[i] := aVals[j,i] NEXT i nRetVal = RMC_AddBarSeries( ; ID_RMC1 , ; // nCtrlID 1 , ; // nRegion oData[1] , ; // nFirstDataValue CntValSeries , ; // nDataValuesCount nTipo , ; // nType RMC_COLUMN_3D_GRADIENT , ; // nEstilo nStyle False , ; // nIsLucent aColores[j] , ; // nColor lh , ; // nIsHorizontal 1 , ; // nWhichAxis EtiqVals , ; // nValuelabelOn 1 , ; // nPointsPerColumn RMC_HATCHBRUSH_OFF ; // nHatchMode ) //RMC_VLABEL_DEFAULT pone etiquetas de valores RMC_VLABEL_NONE no. NEXT j nRetVal = RMC_Draw( ID_RMC1 ) If nRetVal < 0 IsError(16) RETURN nil EndIf RETURN ID_RMC1 FUNCTION IsError(nError) DEFAULT nError := 0 MsgAlert( "Ocorreu um erro em: "+LTRIM(STR(nError)) +CRLF+; "Por Favor, anote este código." ) // Each error number can be traced to a specific place in this prg. RETURN nil *---------------------------- FUNCTION AMaxElement( aArray ) LOCAL i, j, aProv:={}, nmax:=0.0, ntot:=0.0 IF gnTipo = RMC_BARSTACKED FOR i= 1 to CntValSeries FOR j= 1 to Len( aArray ) ntot+=aArray[j,i] NEXT j If nmax < ntot nmax:=ntot ENDIF ntot:=0.0 NEXT i ELSE FOR j= 1 to Len( aArray ) FOR i=1 to CntValSeries //limito a 20 por si pasan mas. If nmax < aArray[j,i] nmax:=aArray[j,i] ENDIF NEXT i NEXT j ENDIF RETURN nmax /* ------------------------------------------------------------------------------------------------------------- Generación de Gráficos Pastel FUNCION gPastel() ------------------------------------------------------------------------------------------------------------- */ FUNCTION gPastel( oWnd, cTit, nEstilo, nAlign, aVals, aLegend, nCor_Gr ) LOCAL nRetVal := 0 LOCAL sLegend := "" LOCAL oColor IS ColorStructL5 LOCAL oData IS DataStructD20 //************** Create the chart ********************** nRetVal = RMC_CreateChart( ; oWnd:hWnd , ; // nParentHandle ID_RMC1 , ; // nCtrlID 0 , ; // nTop 0 , ; // nLeft WndHeight(oWnd:hWnd) -86 , ; // nWidth WndHeight(oWnd:hWnd) -86 , ; // nHeight ColorTransparent , ; // nBackColor RMC_CTRLSTYLEIMAGETILED , ; // nCtrlStyle False , ; // nExportOnly "imagens\BaloesGde.JPG" , ; // sBgImage //"paper.jpg" "" , ; // sFontName 0 , ; // nToolTipwidth 0 ; // nBitmapBKColor ) If nRetVal < 0 ; IsError(1) ; RETURN nil ; EndIf //************** Add Region 1 ***************************** nRetVal = RMC_AddRegion( ; ID_RMC1 , ; // nCtrlID 5 , ; // nLeft 5 , ; // nTop -5 , ; // nWidth -6 , ; // nHeight "Veesor - Automação Comercial - V. 1.37D", ; // sFooter False ; // nShowBorder ) If nRetVal < 0 ; IsError(2) ; RETURN nil ; EndIf //************** Add legend to region 1 ******************************* sLegend = "" FOR i= 1 to Len( aLegend ) sLegend += ( aLegend[i] + "*" ) NEXT i nRetVal = RMC_AddLegend( ; ID_RMC1 , ; // nCtrlID 1 , ; // nRegion sLegend , ; // sLegend RMC_LEGEND_ONVLABELS, ; // nLegendAlign ColorGainsboro , ; // nLegendBackColor RMC_LEGENDNORECT , ; // nLegendStyle ColorBlue , ; // nLegendTextColor 8 , ; // nLegendFoltSize False ; // nLegendIsBold ) If nRetVal < 0 ; IsError(3) ; RETURN nil ; EndIf //************** Add Series 1 to region 1 ******************************* //****** Read color values ****** if nCor_Gr == 2 // bom.. o que eu fiz foi o seguinte // Ao gerar os graficos do PsicoMotor ele acabava tendo as mesmas // cores do Socio Afetivo, ai ficava muito confuso. Entao eu coloquei um // outro parametro na chamada do GPastel2. coloquei um numero no final // ai consigo trocar as cores sem problema.. // oColor:nLong[1] := ColorMediumVioletRed oColor:nLong[2] := ColorOrange oColor:nLong[3] := ColorIndigo oColor:nLong[4] := ColorBlue // Your data goes colors into these 5 slots oColor:nLong[5] := ColorDeepRose else oColor:nLong[1] := ColorDeepYellow oColor:nLong[2] := ColorRed oColor:nLong[3] := ColorGreen oColor:nLong[4] := ColorBlue // Your data goes colors into these 5 slots oColor:nLong[5] := ColorDeepRose endif //****** Read data values ****** FOR i = 1 to Len( aVals) oData:nDouble[i] := aVals[i] NEXT i nRetVal = RMC_AddGridlessSeries( ; ID_RMC1 , ; // nCtrlID 1 , ; // nRegion oData[1] , ; // nFirstDataValue Len( aVals ) , ; // nDataValuesCount oColor[1] , ; // nFirstColorValue 5 , ; // ncolorValuesCount nEstilo , ; // nStyle RMC_PIE_GRADIENT RMC_DONUT_GRADIENT RMC_PYRAMIDE RMC_PYRAMIDE3 RMC_PIE_3D_GRADIENT RMC_PIE_3D nAlign , ; // nAlignment 0 , ; // nExplodemode False , ; // nIsLucent RMC_VLABEL_TWIN , ; // nValueLabelOn RMC_HATCHBRUSH_OFF , ; // nHatchMode 0 ; // nStartAngle ) If nRetVal < 0 ; IsError(4) ; RETURN nil ; EndIf nRetVal = RMC_COText( ; ID_RMC1 , ; // nCtrlID 1 , ; // nCOIndex cTit , ; // sText 70 , ; // nLeft 20 , ; // nTop 300 , ; // nWidth (optional, as are the following...) 250 , ; // nHeight RMC_BOX_NONE , ; // nStyle 0 , ; // nBGColor 0 , ; // nLineColor 0 , ; // nTransparency 0 , ; // nLineAlignment ColorBlack , ; // nTextColor "10C" ; // sTextProperties ) If nRetVal < 0 ; IsError(5) ; RETURN nil ; EndIf //-------------------------------------------------- nRetVal = RMC_Draw( ID_RMC1 ) If nRetVal < 0 ; IsError(6) ; RETURN nil ; EndIf RETURN ID_RMC1 //---------------------------- RMC4XHB.PRG 54 kB · 11 downloads EjemLin.prg 4 kB · 7 downloads EjemBar.prg 4 kB · 7 downloads EjemPastel.prg 5 kB · 8 downloads RMCHART.CH 20 kB · 13 downloads RMCHART2.CH 4 kB · 6 downloads rmchartx.ch 41 kB · 9 downloads todos os arquivos estão vazios !!!, atualiza aqui por favor, obrigado Quote Link to comment Share on other sites More sharing options...
emotta Posted March 27, 2021 Report Share Posted March 27, 2021 Coloque o projeto no Github como público e manda o link pra galera É a forma mais simples de compartilhar um projeto com todos Quote Link to comment Share on other sites More sharing options...
agp.ds Posted April 27, 2021 Report Share Posted April 27, 2021 Achei interessante também, poderia disponibilizar no Em 27/03/2021 at 17:10, emotta disse: Coloque o projeto no Github como público e manda o link pra galera É a forma mais simples de compartilhar um projeto com todos Também achei interessante, pena não estar disponível mais... Quote Link to comment Share on other sites More sharing options...
marcioe Posted April 27, 2021 Author Report Share Posted April 27, 2021 Olá a todos a minha tela ficou assim Usando Xbrowse com array 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.