Embed a chart in a Web application using NetBeans

Source: Internet
Author: User
Tags netbeans

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] },

          ]
        }");
?>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.