.  

 

 

.
.

22 / 02 / 2017

Usuarios conectados: 4

Cargando documento...

Buscar:

.

Este Sitio:

Principal

Dreamweaver

Fireworks

JavaScript

CSS

Sonido

Artículos

Links

E-ufemismos

Descargas

Historial

 

Mailing List:

Suscríbete a la lista de correo, No practico spamming y ofrece algunas ventajas.

Pulsa aquí para saber más y suscribirte.

 

Recomendados:

Tecnorama >Dreamweaver Extensions

 

PHP Pie Chart

Versión para imprimir | Translate this page

PHP Pie Chart: Just for DMX and php_mysql Server Model: This extension will let you create pie charts (using percentages) from a Recordset.

The extension won't create the Recordset: It just draws the chart according to the results. The recordset must return, at least, a field with numeric data and the extension will calculate the percentage for each value and it will put it in the pie chart. Let's see an example:
We've got the tables "companies" and "sales":

COMPAPNIES

  

SALES

id_company

company_name

id_sale

id_company

amount

1

Microsoft

1

2

2

2

Adobe

2

3

150

3

Macromedia

3

1

55


You can see that there's a relationship between them (the field "id_company") and we want to guess the sales percentage for each company. Our Recordset could be:
SELECT SUM(amount),company_name
FROM sales, companies
WHERE sales.id_company=companies.id_company
GROUP BY companies.id_comapny


this Recordset will display:

company_name

amount

Microsoft

55

Macromedia

150

Adobe

2


With this recordset, we can use the extension:

Recordset: Select the name of your Recordset.

Display: You can uncheck it if you only want to show the percentages in the pie chart without legend.

Label Field: This field should show the label attached to every percentage (the company name, in our example).

Data Field: Select which field stores the numeric data ("amount" in our example).

Font Size: Select a font size for your label.

minPercent: You must indicate the smallest percentage the pie chart should display. All values smaller than this will be grouped as "Other". remember that 0.01 equals 1% and 1.00 equals 100%. In the picture, you can see that all values smaller than 22% (0.22) will be grouped as "Other".

Width / Height: with and height for the pie chart image.

BgColor: Background color.

Linecolor: Color for the lines that separate every piece of the chart.

Color1...color8: colores for each piece. If the chart displays more than 8 results, color 1 will be used again and so on.

See a Demo



Limitations:


To use this extension, your PHP must have support for GD 1.6 or above.

Remember that, when using this extension, You can't add anything else to your document. Don't use it embedded into a normal document: If you want to embed the resulting chart in a document, you must link to it as if it were a common image. How can you do it? It's easy:

For example. You have saved the php file with the code to "draw" the chart as "chart.php" and you want to show it in another document, called "companies.php". Open this file in DWMX, Select "insert Image" and select the file "chart.php":

<img src="images/chart.php">

If your recordset need some parameters, you can add it to the path:

<img src="images/chart.php?yourparam=44">

And the pie chart will be shown as an image in your document.

Download it here


Acknowledgements: This extension has been made with code written byJames Heinrich, from silisoftware. In his site you'll find more useful PHP scripts.Thanks, James.

Comments? 28, so far. Displaying 1 ->5

1.- AsianGirl dit :Coucou, merci pour ce con#murs!J&c8217;emoénage bientôt dans mon propre appart, donc ce concours tombe à pic!Mon produit préféré dans la sélection cocon est le plaid.Bonne soirée!

2.- Thank you so much for feaadturading Jason Crabb in the Denadver Post!a0 He has sung for years with his famadily, The Crabb Famadily and has venadtured on to a solo career.a0 He has the most powaderadful voice, eotoimn-stirring voice and truly loves God.a0 He has won Gramadmies and Dove Awards and is very deservading of these.a0 Anyadone who expeadriadences one of Jason’s conadcerts come away being blessed and feelading the presadence of God.a0 We are very foradtuadnate to have such a fanadtasadtic singer and such a proadfound speaker for God.a0 His new CD/DVD is absolutely awesome!!! http://tulebfzgwum.com [url=http://bweuocykvb.com]bweuocykvb[/url] [link=http://qoyeegq.com]qoyeegq[/link]

3.- 我話你聽..我會一生一世都咁憎你omg i literally laeughd out. as if her hatred matters. and, please watch out erica, this 'ruby' hates you now, and you're all on her mind, if anything happened that makes her your fan, it would be teerible. LOL

4.- Adrian You need to provide us exact birth time, else hoscorope will not be correct on basis of which AstroGuru will make predictions. Alternatively in such cases where birth time is not sure, AstroGuru can generate the correct hoscorope by reverse engineering based on your past life events and personality. This is only possible by teleconferencing, I would recommend you to fill an appointment request.Admin http://ewziaszot.com [url=http://cnetnwzq.com]cnetnwzq[/url] [link=http://zdpautiud.com]zdpautiud[/link]

5.- Manisha jiI looked into your hosrocope and delayed marriage is clearly indicated. You may be experiencing breaking of alliances even at last stages. Your marriage can even be delayed even upto 5 years. However you’ve intermittent favorable time also in which you attempt it could be possible. Your married life also looks troubled. However so far you had a great education and lavish life. You have a great parental support and you are more close to your Mom than Dad.As a remedy for marriage related issue, rituals for three troubling planets Rahu, Shani and Moon is required. Consult any local Pandit to conduct this rituals. You may also fast on Monday and pray to lord Ganesh.I wish i could write more but I am slow at typing. If you have any more queries talk to me over phone, it will be convenient. Rest I wish you good luck.Jivendra Pandey

Previous | 1 - 5 | 6 - 10 | 11 - 15 | 16 - 20 | 21 - 25 | 26 - 28 | Next

Add your Comments



Escribe el cdigo de la imagen superior:

:

TECNORAMA es simplemente una página personal. No sirve ni de promoción del autor ni cosas por el estilo.
Todos los cdigos, textos y tutoriales son de libre uso mientras se mencione al autor (no es mucho pedir)
Este sitio es compatible con IE6/NS6/Mozilla1.0
Para contactar, puedes enviarme un e-mail a tecnorama@hotmail.com