Página 2 de 3
Enviado: 12 Fev 2008 15:32
por marcos.gurupi
Kra eh um espetaculo. Inclusive jah estou criando alguma coisa! Mas alguem sabe como uso os centavos no grafico? Quando adiciono os centavos ele acrecenta mais dois caracteres, ou seja, um valor q seria
150,831.31 ficaria 150,831,031.00.
Obrigado.
Enviado: 12 Fev 2008 15:39
por marcos.gurupi
Opa falha minha, eu acabo de conseguir, mas aproveitando o topico alguem jah conseguio imprimir o grafico?
Marcos Roberto
Enviado: 13 Fev 2008 00:24
por sygecom
Puxa, empaquei nisso ai ! ai resolvi dar uma analisada no FastReport que faz mil e uma funções inclusive graficos....estou estudando ainda.
Enviado: 13 Fev 2008 08:57
por Luciano Bonfim
será que tem como gerar o gráfico para BMP e imprimí-lo usando a win32prn?
Enviado: 13 Fev 2008 11:14
por marcos.gurupi
Kra eu me apaixonei pela DLL eh simples d+ fazer um grafico vou investir meu tempo nela. No modulo de ajuda da DLL tem um comando chamado RMC_Draw2Printer, mas n consegui traduzir isso na calldll() o modulo de ajuda diz assim:
Código: Selecionar todos
Syntax
nResult (LONG) = RMC_Draw2Printer(
ByVal nCtrlId (LONG),
Optional ByVal nPrinterDC (LONG),
Optional ByVal nLeft (LONG),
Optional ByVal nTop (LONG),
Optional ByVal nWidth (LONG),
Optional ByVal nHeight (LONG),
Optional ByVal nType (LONG)
)
Parameter
nCtrlId (LONG)
Unique ID of the chart control, which shall be printed.
nPrinterDC (LONG)
A valid printer DC. If omitted or 0, 1 or 2: the default printer is used. If no default printer is found, the first printer is used. If 1: printing takes place in portrait mode; if 2: printing takes place in landscape mode.
nLeft (LONG)
Left corner of the output in millimeter. See Remarks
nTop (LONG)
Top of the output in millimeter. See Remarks
nWidth (LONG)
Width of the output in millimeter. See Remarks
nHeight (LONG)
Height of the output in millimeter. See Remarks
nType (LONG)
RMC_EMF (Default): printing is done through a memory based EMF file.
RMC_EMFPLUS Printing is done through a memory based EMF+ file.
RMC_BMP: printing is done through a bitmap.
To be honest: I can't give a general advice, which option you should use. I found no significant differences on my printer (HP G85) between the three modes. I think, in most cases the default setting will be alright, but make your own experiences.
Return value
0
No error, function succeeded.
RMC_ERROR_CTRLID
Wrong control ID (0 or no chart with this control ID was found).
RMC_ERROR_EMF
Error while creating the EMF file for printing.
RMC_ERROR_PRINT
Error while creating the printer DC.
Remarks
You can call RMC_Draw2Printer either any time after you called RMC_Draw (for instance if your user clicked on an available Print button) or "stand alone", without painting on the screen. In this case parameter nExportOnly in RMC_CreateChart() must be TRUE. Then, after the necessary function calls for designing your chart, you call RMC_Draw2Printer, followed by RMC_DeleteChart()!
If you set the nLeft, nTop,nWidth and nHeight parameters the output will be accordingly positioned on the paper with possibly small deviations. If you omit the value(s) the following rules apply:
nLeft: the output will be centered between the left and the right edge of the paper.
nTop: the output will start 15 mm below the printable top edge of the paper.
nWidth: the output will have 75% the size of the printable document's width.
nHeight: the output will have the same ratio regarding the height as the original chart.
Eu n saberia encontrar o q eh LONG.
Enviado: 13 Fev 2008 11:58
por sygecom
Luciano Bonfim escreveu:será que tem como gerar o gráfico para BMP e imprimí-lo usando a win32prn?
Usando a GD da CONTRIB para criar os graficos, e a Win32prn para imprimir ai vai....
Re: RMchart (gráficos comerciais profissionais)
Enviado: 12 Ago 2008 16:35
por Luciano Bonfim
Caro Marcos,
Näo consegui enteder a lógica dessa string que contem os dados para gerar o gráfico. Agora estou precisando gerar uns gráficos para um cliente meio urgente e agradeceria se vc pudesse me dar uma luz para eu poder criar minha própria string de dados..
Muito Obrigado
Re: RMchart (gráficos comerciais profissionais)
Enviado: 12 Ago 2008 22:16
por marcos.gurupi
Eu consegui assim:
1- Abri o RMCDesigner com ele vc pode criar o grafico q quiser.
2- Apos criar o grafico vc entra em FILE/Get data string entao cola o codigo no seu PRG. Fica assim:
Dim sData as STRING
sData = sData + "00003880|00004450|000051|000061|000072|00008-1296|00009412|00011Courier New|0001"
sData = sData + "220|100011|100035|100045|10005-5|10006-5|1000912|100101|100111|100131|100181|100"
sData = sData + "201|100215000|1002211|100237|100272|100331|100342|1003512|100377|100468|100482|1"
sData = sData + "0052-1|100541|100558|10060-1|100942|100632|100652|10180Posto de Molas Gurupi|101"
sData = sData + "81Media de O.S. a vista e a prazo|10182O.S. a vista*O.S. a prazo|10184Valor Medi"
sData = sData + "o em R$|10187Janeiro*Fev.*Marco*Abril*Maio*Junho*Julho*Agosto*Setembro*Outubro*N"
sData = sData + "ovembro*Dezembro|110011|1100221|1100434|110062|1101421|1102115|110221|1102312|11"
sData = sData + "0261|11053100*300*500*700*900*1100*1300*1500*1700*1900*2100*2300|120011|1200221|"
sData = sData + "1200434|120061|1201421|12019-9868951|1202115|120221|1202312|120261|12053400*800*"
sData = sData + "1200*1600*2000*2400*2800*3200*3600*4000*4400*4800"
Entao eh soh substituir os valores correspondente ao grafico, ou seja, a parte em negrito sao valores q deverao ser substituido.
Marcos Roberto
Re: RMchart (gráficos comerciais profissionais)
Enviado: 13 Ago 2008 12:38
por Luciano Bonfim
interessante,
Me corrige se estiver errado, pelo que entendi tudo que começa com "asterístico" säo dados (legendas e pontos do gráfico)
Outra pergunta: vc já conseguiu imprimir o gráfico?
Muito Obrigado
Luciano Bonfim de Azevedo
Re: RMchart (gráficos comerciais profissionais)
Enviado: 14 Ago 2008 00:16
por marcos.gurupi
Olha sobre os dados sim e nao pq vc pode observar q existem tb alguns dados como o nome da empresa q n tem asteristico mas no geral eh sim. Legenda e valores dos graficos sao seguidos de asteristicos. Sobre a impressao eu consegui tb. No site da RMC tem o exemplos para xharbour. Se vc tiver alguma dificuldade me chame eu jah imprimo inclusive vc pode ateh exportar para png.
Marcos Roberto
Re: RMchart (gráficos comerciais profissionais)
Enviado: 23 Mar 2009 11:01
por ANDRIL
Pessoal,
Estou precisando colocar grafico de barras, pizza e linha de projeção no meu sistema em HwGui, vi esse topico, acessei o link para baixar o RMChart mais a pagina fica em branco.
Se alguem souber de onde posso baixa-la, agradeço.
Só tem esta forma de fazer graficos atraves da HwGui, pois vi os exemplos que o Leonardo mencionou sobre a pasta GD da CONTRIB só achei algo sobre codigo de barras.
Ate+
Re: RMchart (gráficos comerciais profissionais)
Enviado: 23 Mar 2009 11:28
por sygecom
Pode usar a LIB GD da CONTRIB para criar os Graficos, veja o exemplo do link abaixo:
http://www.4shared.com/file/68584240/2c ... co_gd.html
Re: RMchart (gráficos comerciais profissionais)
Enviado: 23 Mar 2009 14:08
por ANDRIL
Leonardo, obrigado. Baixei o exemplo e vi os graficos. Só tem os 3 tipos de graficos do exemplo, onde posso achar uma documentacao dessa dll.
Quanto a RmChart eu vi que só esta disponivel no SAMPLES da Hwgui 2.17.
Sabe dizer se pode ser usada com a Hwgui 2.16, pq qdo compilo surge o erro:
Código: Selecionar todos
Error: Unresolved external '_HB_FUN_HACTIVEX' referenced from C:\HWGUI_217\SAMP
ES\RMCHART\OBJ\RMSAMPLE.OBJ
Ate+
Re: RMchart (gráficos comerciais profissionais)
Enviado: 23 Mar 2009 15:24
por sygecom
Acredito que rode com a 2.16, mas você tem que habilitar a compilação dela no MAKE_B32.BAT.
Tire o REM da frente de set ACTIVEX_SUPPORT=ON e recompile suas LIB usando o MAKE_B32.BAT.
Obs: Pq não esta usando a versão da CVS da Hwgui a 2.17 ? uso a versão 1.0.0 do xharbour e esta rodando tudo redondo !!!
Re: RMchart (gráficos comerciais profissionais)
Enviado: 28 Abr 2010 10:54
por athayde
compartilhando com a galera
codigo para rmchart dll e hwgui usando harbour 2.1 onde as chamadas dlls sao diferentes
Código: Selecionar todos
#include "windows.ch"
#include "guilib.ch"
#include "hbdyn.ch"
#define ID_CHART 5001
#define ID_CHART2 5002
Function Main
hDll:= hb_LibLoad("rmchart.dll")
PREPARE FONT oFont NAME "Times New Roman" WIDTH 0 HEIGHT -17 CHARSET 4
INIT WINDOW oMainWindow MAIN MDI TITLE "Example RMCHART";
AT 0,0 SIZE 1300,650 ;
FONT oFont
MENU OF oMainWindow
MENU TITLE "Charts"
MENUITEM "Charts" ID 1100 ACTION Chart()
ENDMENU
ENDMENU
oMainWindow:activate()
hb_LibFree( hDll )
Return nil
function chart
cLabel1 := "Coluna 1"
cLabel2 := "Coluna 2"
cLabel3 := "Coluna 3"
cLabel4 := "Coluna 4"
cLabel5 := "Coluna 5"
sTemp1 := "00003600|00004450|000051|000061|00008-984833|00009310|00011Tahoma|100011|100035|100045|";
+"10005-5|10006-5|1000911|100101|100111|100131|100181|100200|10021100|1002211|100238|100331|";
+"100341|100355|100378|100481|100491|10051-16776961|10052-256|10053-1|100541|100558|";
+"10056-16777216|10057-16777216|10060-16777216|10061-16777216|100626|10181This is the chart's caption|";
+"10187Label 1*Label 2*Label 3*Label 4*Label 5|110011|110021|110031|110043|110053|11006-1|";
+"110091|110131|11014-1|110171|1102111|110221|110235|1105350*70*40*60*30"
nSize1X := VAL( SUBS( sTemp1, AT("00003",sTemp1)+5 , 3 ) )
nSize1Y := VAL( SUBS( sTemp1, AT("00004",sTemp1)+5 , 3 ) )
sTemp1 := STRTRAN( sTemp1, "Label 1", cLabel1 )
sTemp1 := STRTRAN( sTemp1, "Label 2", cLabel2 )
sTemp1 := STRTRAN( sTemp1, "Label 3", cLabel3 )
sTemp1 := STRTRAN( sTemp1, "Label 4", cLabel4 )
sTemp1 := STRTRAN( sTemp1, "Label 5", cLabel5 )
sTemp2 := "00003650|00004450|000051|000061|000071|00008-6697831|00009412|00011Tahoma|100011";
+ "|1000310|1000410|10005-5|10006-5|1000910|100101|100111|100121|100131|100181|1002";
+ "00|100217|1002215|100238|100272|100331|100341|100358|100378|100411|100482|100492";
+ "|10051-6751336|10052-15132304|10053-983041|100541|100558|10056-16777077|10057-16";
+ "777077|100586|10060-16777077|10061-1468806|100622|10180data source: www.federalr";
+ "eserve.gov + www.ecb.int|10181Prime Rates in USA und Euroland|10183 %|101871999*";
+ "2000*2001*2002*2003*2004*2005*2006|110011|1100221|110035|1100434|110052|110063|1";
+ "10073|1100970|1101312|110171|11019-16744448|1102115|110221|1102396|110262|110521";
+ "2|110534.75*4.75*4.75*4.75*4.75*5*5*5.25*5.25*5.25*5.5*5.5*5.5*5.75*6*6*6.5*6.5*";
+ "6.5*6.5*6.5*6.5*6.5*6.5*5.5*5.5*5*4.5*4*3.75*3.75*3.5*3*2.5*2*1.75*1.75*1.75*1.7";
+ "5*1.75*1.75*1.75*1.75*1.75*1.75*1.75*1.25*1.25*1.25*1.25*1.25*1.25*1.25*1*1*1*1*";
+ "1*1*1*1*1*1*1*1*1*1*1.25*1.5*1.75*2*2.25*2.25*2.5*2.75*2.75*3*3.25*3.25*3.5*3.75";
+ "*3.75*4*4.25*4.5*4.5*4.75*4.75*5*5.25*5.25*5.25*5.25*5.25*5.25*5.25|120011|12002";
+ "21|120035|1200434|120052|120063|120073|1200950|1201312|120171|12019-2448096|1202";
+ "115|120221|1202396|120262|1205212|120533*3*3*2.5*2.5*2.5*2.5*2.5*2.5*2.5*3*3*3*3";
+ ".25*3.5*3.75*3.75*4.25*4.25*4.5*4.5*4.75*4.75*4.75*4.75*4.75*4.75*4.75*4.5*4.5*4";
+ ".5*4.25*3.75*3.75*3.25*3.25*3.25*3.25*3.25*3.25*3.25*3.25*3.25*3.25*3.25*3.25*3.";
+ "25*2.75*2.75*2.75*2.5*2.5*2.5*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*";
+ "2*2*2*2*2*2.25*2.25*2.25*2.5*2.5*2.5*2.75*2.75*3*3*3.25*3.25*3.5|010011|010054|0";
+ "100721|01014-16744448|010222|01024216*287|01025109*109|010272|010283|010012|0100";
+ "51|01010295|01011102|010191|01026USA (Federal Funds Rate)|010013|010054|0100721|";
+ "01014-10496|010222|01024260*287|01025192*192|010272|010283|010014|010051|0101029";
+ "5|01011185|010191|01026Euroland (Prime Rate)"
nSize2X := VAL( SUBS( sTemp2, AT("00003",sTemp2)+5 , 3 ) )
nSize2Y := VAL( SUBS( sTemp2, AT("00004",sTemp2)+5 , 3 ) )
INIT WINDOW oFormChart1 MDICHILD ;
TITLE "teste 1" ;
STYLE WS_VISIBLE + WS_OVERLAPPEDWINDOW;
AT 0,0;
SIZE nSize1X+20,nSize1Y+30;
FONT oFont;
ON INIT {|o| initForm_Chart1(o) };
oFormChart1:Activate(.T.)
INIT WINDOW oFormChart2 MDICHILD ;
TITLE "teste 2" ;
STYLE WS_VISIBLE + WS_OVERLAPPEDWINDOW;
AT nSize2X,0;
SIZE nSize2X+20,nSize2Y+30;
FONT oFont;
ON INIT {|o| initForm_Chart2(o) };
ON EXIT {|o| exitForm_Chart2(o) }
oFormChart2:Activate(.T.)
return .T.
function initForm_Chart1(o)
nRetVal := HB_DYNCALL( {"RMC_CREATECHARTFROMFILE", hDll, HB_DYN_CALLCONV_STDCALL },o:handle,ID_CHART,0,0,0,sTemp1)
nRetVal := HB_DYNCALL( {"RMC_DRAW", hDll, HB_DYN_CALLCONV_STDCALL },ID_CHART)
return(.t.)
function exitForm_Chart1(o)
nRetVal = HB_DYNCALL( {"RMC_DELETECHART", hDll, HB_DYN_CALLCONV_STDCALL },ID_CHART)
return(.t.)
function initForm_Chart2(o)
nRetVal := HB_DYNCALL( {"RMC_CREATECHARTFROMFILE", hDll, HB_DYN_CALLCONV_STDCALL },o:handle,ID_CHART2,0,0,0,sTemp2)
nRetVal := HB_DYNCALL( {"RMC_DRAW", hDll, HB_DYN_CALLCONV_STDCALL },ID_CHART2)
return(.t.)
function exitForm_Chart2(o)
nRetVal = HB_DYNCALL( {"RMC_DELETECHART", hDll, HB_DYN_CALLCONV_STDCALL },ID_CHART2)
return(.t.)
[]s
Fernando