Como corrijo una grafica?

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México

Como corrijo una grafica?

Post by Javier Tovar »

Como corrijo una gráfica?

En las gráficas de barras salen asteriscos en vez de cantidades, cuando las cantidades son mayor a 1,000,000.00, que se tiene que hacer para solucionarlo, ya trate de encontrar algo en el foro pero no lo encontré.

Saludos y gracias por la atención que tengan a este post.
//////////////////////////////////////////////////////////////////////////////////////////////

As I edit a graph?

In the bar charts depart asterisks instead of numbers when the numbers are greater than 1,000,000.00, you have to do to fix it, and try to find something in the forum but not found it.

Greetings and thanks for the care you have for this post.
Error en grafica.jpg
Error en grafica.jpg (65.83 KiB) Viewed 3392 times
Midemo.rar
(703 Bytes) Downloaded 188 times
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: Como corrijo una grafica?

Post by andyglezl »

Hola Javier

Pues con esas ventas, yo me apunto a programar para ti... :lol:
-------------------------------------------------------------------------
Hi Javier

Well, with these sales, I'm in a program for you ... :lol:
Andrés González López
Desde Guadalajara, Jalisco. México.
User avatar
gfilatov
Posts: 1067
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Contact:

Re: Como corrijo una grafica?

Post by gfilatov »

Hi Javier,

It is a known limitation in the Graph source and there is a simple workaround for it.

Please take a look for an updated sample below:

Code: Select all

/*
 * HMG - Harbour Win32 GUI library Demo
*/

#include "hmg.ch"

Function Main

Local aSer:={ {12314280,1220420,12312870,25347, 12347640} }
Local serie

For each serie in aSer
	For i:=1 To Len(serie)
		serie[i] := aSer[1][i] / 1000
	Next
Next

	Define Window GraphTest ;
		At 0,0 ;
		Width 640 ;
		Height 480 ;
		Title "Graph" ;
		Main ;
		Nomaximize ;
		Icon "Main" ;
		BackColor { 255 , 255 , 255 } ;
		On Init DrawBarGraph ( aSer ) ;

		Define Button Button_1
			Row	415
			Col	20
			Caption	'Bars'
			Action DrawBarGraph ( aSer )
		End Button

		Define Button Button_4
			Row	415
			Col	500
			Caption	'Print'
			Action PRINT GRAPH OF GraphTest PREVIEW DIALOG
		End Button

	End Window

	GraphTest.Center

	Activate Window GraphTest

Return

Procedure DrawBarGraph ( aSer )

	ERASE WINDOW GraphTest

	DRAW GRAPH							;
		IN WINDOW GraphTest					;
		AT 20,20						;
		TO 400,610						;
		TITLE "Sales and Product (in thousands)"		;
		TYPE BARS						;
		SERIES aSer						;
		YVALUES {"Jan","Feb","Mar","Apr","May"}			;
		DEPTH 15						;
		BARWIDTH 15						;
		HVALUES 10						;
		SERIENAMES {"Serie 1"}		;
		COLORS { {128,128,255} }	;
		SHOWGRID                        			;
		3DVIEW    						;	
		SHOWXVALUES                     			;
		SHOWYVALUES                     			;
		SHOWLEGENDS 						;
		NOBORDER

	
Return
Attachments
Correct graph
Correct graph
screen.png (7.16 KiB) Viewed 3363 times
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein
User avatar
Agil Abdullah
Posts: 204
Joined: Mon Aug 25, 2014 11:57 am
Location: Jakarta, Indonesia
Contact:

Re: Como corrijo una grafica?

Post by Agil Abdullah »

Thanks to Javier for sharing this Topic.
Thanks to Grigory for sharing codes.

Salam Hangat dari Jakarta.
Agil Abdullah Albatati (just call me Agil)
Programmer Never Surrender
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Como corrijo una grafica?

Post by esgici »

Thanks Javier and Grigory :)

Happy HMG'ing :D
Viva INTERNATIONAL HMG :D
Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México

Re: Como corrijo una grafica?

Post by Javier Tovar »

gfilatov wrote:Hi Javier,

It is a known limitation in the Graph source and there is a simple workaround for it.

Please take a look for an updated sample below:
If Gregory Filatov had already done that and put in place of "Series Name" put ("Quantity X 1.000"), but does not look very professional. I hope there will soon be a better solution.

Thanks for the attention.

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Si Gregory Filatov, ya había hecho eso y poner en lugar de "Nombre de la serie" poner ("Cantidades X 1,000"), pero no se ve muy profesional. Espero que pronto haya una mejor solución.

Gracias por la atención recibida.
Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México

Re: Como corrijo una grafica?

Post by Javier Tovar »

andyglezl wrote:Hola Javier

Pues con esas ventas, yo me apunto a programar para ti...
:lol: :lol: :lol:

Esa es mi intención, estoy haciendo una aplicación con datos reales de una empresa y pues haber si les gusta mi programa, ya que ellos lo llevan en Excel, aunque trabaja bien!, pero espero que les guste la nueva forma de trabajar, solo estoy haciéndoles un demo! :)

Saludos
User avatar
gfilatov
Posts: 1067
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Contact:

Re: Como corrijo una grafica?

Post by gfilatov »

Javier Tovar wrote:...
but does not look very professional. I hope there will soon be a better solution.

Thanks for the attention.
Hi Javier,

You are right! Therefore Minigui Ext have a 'DataMask' clause in the Draw Graph command.

You can see a correct result for DATAMASK "99,999,999" on this screenshot below.
Attachments
scrshot.png
scrshot.png (13.9 KiB) Viewed 3253 times
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein
Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México

Re: Como corrijo una grafica?

Post by Javier Tovar »

gfilatov wrote:Hi Javier,

You are right! Therefore Minigui Ext have a 'DataMask' clause in the Draw Graph command.

You can see a correct result for DATAMASK "99,999,999" on this screenshot below.
Bien Gregori Filatov, espero que los desarrolladores de HMG hagan esto para la gráfica!!!, yo por lo tanto voy a tratar de encontrar una solución, aunque no sea muy profesional, pero que se vean las cantidades correctas o no ponerlas y poner una tabla extra al gráfico con los datos.

Saludos y gracias por la atención :)
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Filatov Gregori Well, I hope developers do this for HMG graphic !!!, so I'll try to find a solution, though not very professional, but that the right quantities or look them and put a Extra to graph the data table.

Greetings and thanks for the attention :)
endor
Posts: 17
Joined: Wed Sep 10, 2014 6:31 am

Re: Como corrijo una grafica?

Post by endor »

Thank you for sharing, Javier and Grigory :)

I just have a thought, Is there a way to put the graph in a tab? :idea:

Like page 1 - description, page 2 - details, page 3 the graph? or something like that?

coz I have tried, the text only show but the graph is behind the tab and displays blank. :?:
-----------
Rey
Post Reply