Using the JMaki framework and NetBeans 6 to create a WEB application that supports charts is fairly straightforward. Suppose you need to draw the percentage of income that an organization earns each month of the year. The pie chart will probably be your best choice:
How do you build such a chart? The basic steps are as follows:
First, you will need to install the JMaki plug-in via the NetBeans Update Center (Tools | Plugins | Available Plugins | JMaki Ajax Support)
After you get the appropriate chart Gallery (java.net project), add it to NetBeans (Tools | Palette | ADD JMaki Library)
Create a new Web project and select the JMaki framework in the Project Wizard dialog
From the palette (Find-jmaki-charting-widget ...) part) Drag and drop a "Google Pie" component to the <body> tag behind the project default index.jsp page
Deploy and customize your application as needed
If you are not a Java developer and still want the same results in your PHP projects and applications, use the following code snippet to create the chart.
<?php
addWidget( array(
"name" =>"jmaki.charting.plotkit.pie",
"args"=>"{colorScheme:2}",
"value"=>"{
xAxis : {
title : 'Months',
labels : [{ label : 'January'},
{ label : 'February'},
{ label : 'March'},
{ label : 'April'},
{ label : 'May'},
{ label : 'June'},
{ label : 'July'},
{ label : 'August'},
{ label : 'September'},
{ label : 'October'},
{ label : 'November'},
{ label : 'December'}
]
},
data : [
{label : 'Set 1', values : [25, 45, 25, 45, 50, 25, 35, 25, 25, 20, 35, 45] },
]
}");
?>