A Quick Guide to using NetCharts Pro as Java Applets

NetCharts Pro supports rendering interactive visualizations as Java Applets. This page summarizes a minimum process for installing and running NetCharts Pro Charts as Java Applets. These are the minimum steps necessary to get up and running. If you are going to read nothing else in this documentation about applets, read this page!

  1. Download NetCharts Pro - Download the NetCharts Pro.
  2. Deploy and configure web server - Deploy the NetCharts Pro Applets files to the web server and make any configuration changes
  3. Create HTML page with <applet> - Create a page to render a NetCharts Pro chart as a Java Applet image for display within a web page.
  4. View the HTML page and chart - Request the HTML page with the NetCharts Pro chart as a Java Applet to see it in action.

Step 1 - Download NetCharts Pro

Click the Download NetCharts Pro button above and use the “Download Now” option to download the NetCharts Pro library files. Upon registering you will receive an email with download information. Unzip the distribution and this will provide you a fully functioning copy of NetCharts Pro, including the signed NetCharts Pro Applets JAR file ncp-core.jar, and NFLicense.dat license file, on your local system.

Step 2 - Deploy and configure web server

Two files, ncp-core.jar, and NFLicense.dat, are the only two files needed to be deployed to the web server. You can create a virtual directory in your web server named netcharts pointed to the /applets directory of the unzipped NetCharts Pro distribution. Or, alternatively, place these two files at the top level of your web server in a directory called netcharts. For example, in Microsoft’s IIS server you may create the directory c:\inetpub\wwwroot\netcharts.

NOTE: Recent browser updates are changing the way unsigned Java applets and web start applications are run. The default security level for Java applets and web start applications has been increased from "Medium" to "High" affecting the conditions under which unsigned Java web applications can run. A signed JAR file is now recommended for applet deployments.

A signed version of the NetCharts Pro core library, ncp-core.jar, used to serve NetCharts Pro charts in applets mode is included within the NetCharts Pro distribution in the /applets folder. If you are accessing templates or CDL files on a different port or server, use the signed JAR file within the /applets/all-permissions folder to allow cross-domain access.

This will enable any HTML file in the web server hierarchy to easily reference the applets using the applet tags like:

<applet codebase='/netcharts' archive='ncp-core.jar' code='netcharts.apps.NFPiechartApp' ...>

When using NetCharts Applets in Microsoft IIS server, the default configuration for IIS will prevent the validation of the license for NetCharts Applets. This results in a screen starting that NetCharts Applets is not properly licensed. So most IIS servers need to have the .dat MIME type configured to allow access to the license file. To do so follow these instructions:

  1. Open the Internet Information Services Management Console.
  2. Select the site or server.
  3. Click MIME Types (it might be under the IIS section).
  4. Click Add button.
  5. In the Extension field, type in .dat.
  6. In the Content Type or MIME Type field, type in text/plain.
  7. Apply the new settings.

Your IIS instance might have slightly different instructions but essentially find the MIME Types control area and add the .dat MIME Type as text/plain.

Step 3 - Create HTML page with <applet>

Create a new simple web page and include a basic NetCharts Pro Applet chart. Here is a sample <applet> element to use:

<applet name='mychart' codebase='/netcharts' archive='ncp-core.jar' 
	code='netcharts.apps.NFBarchartApp' width='500'	height='300'>
<param name=’permissions’ value=’sandbox'/>
<param name=’NFParamScript’ value='
	AntiAlias = "ON";
	Background = (, NONE, 4, , TILE, , SQUARE, SQUARE, SQUARE, SQUARE, );
	ColorTable = x0a9696, xfec619, x94c209, xcc7138, xd64646, x8e468e, xfb2f99, xb8e0ff, xcae78f, xf1aab2, xa29c65, x604300, x339276, x64bcb7;
	DwellLabel = ("", black, "Arial", 10, 0, CENTER);
	DwellLabelBox = (xffffff_229, BOX, 1, , TILE, grey, SQUARE, SQUARE, SQUARE, SQUARE, white);
	BottomColor = xc0c0c0_127;
	BottomMajorTicColor = white;
	BottomTics = ("", x000000_178, "Arial Plain", 10, 0, CENTER, , CENTER);
	LeftColor = xc0c0c0_127;
	LeftMajorTicColor = white;
	LeftTics = ("", x000000_178, "Arial Plain", 10, 0, CENTER, , CENTER);
	LeftFormat = (DECIMAL, "###,###.###", null, null);
	GridAxis = ("BOTTOM", "LEFT");
	Grid = (xefefef_127, , xefefef_127, , TILE);
	GridLine = (BOTH, SOLID, 1);
	GraphLayout = VERTICAL;
	BarSymbol = (BAR, );
	BarWidth = 70;
	Bar3DDepth = 0;
	BarBorder = (NONE, 1, );
	BarDropShadow = (x000000_110, 0.01, 0.0090, 0.02);
	BarHighlights = (GRADIENTHORIZONTAL, xffffff_80, xffffff_0, 0.0010, 0.0010, 0.0010, 0.0010, -1, -1, "SQUARE_0.0", "SQUARE_0.0", "SQUARE_0.0", "SQUARE_0.0"),
		(GRADIENTHORIZONTAL, xffffff_0, x000000_80, 0.0010, -0.09, 0.0010, -0.09, -0.09, -1, "SQUARE_0.0", "SQUARE_0.0", "SQUARE_0.0", "SQUARE_0.0");
	BarCorners = ("ROUND_0.1", "ROUND_0.1", "ROUND_0.1", "ROUND_0.1");
	DataSets = ("DataSet1", , BAR, 4, FILLED);
	DataSet1 = 10, 20, 12, 15, 5, 10;
	BarLabels = "Label1", "Label2", "Label3", "Label4", "Label5", "Label6";
'>
</applet>

Save this new file as mychart.html in the root directory of the web server. Make sure the web server is started, and able to receive requests from a browser.

NOTE: Recent browser updates are changing the way unsigned Java applets and web start applications are run. The default security level for Java applets and web start applications has been increased from "Medium" to "High". Previously, as long as you had the latest secure Java release installed applets and web start applications would continue to run as always. With the "High" setting the user is always warned and requires that users indicate acceptance before any application is run and the JRE may not allow unsigned applications to run at all, to prevent silent exploitation.

Using the signed JAR file and running your applets in sandbox mode, you can meet the security to run NetCharts Pro Applets and it is possible to limit the warning dialogs to a single dialog when the first NetCharts Pro is presented.

If you are accessing templates or CDL files on a different port or server, use the signed JAR file within the /applets/all-permissions folder and use the all-permissions value for the permissions parameter to allow cross-domain access.

Step 4 - View the HTML page and chart

With the page created and saved, start up a browser, and browse to http://localhost/mychart.html (replace localhost if the page is deployed to a different system). The following chart should appear: