← EasyCharts Overview

Frequently Asked Questions

Licensing, features, installation, and troubleshooting.

EasyCharts Basics

1. What is EasyCharts?

EasyCharts is a Javatm based charting library that enables you to add charts to your java applications and web pages. The library contains AWT based chart components, applets, and a chart servlet.

2. What chart types do EasyCharts support?

EasyCharts supports horizontal and vertical bar charts, stacked bar charts, pie charts, line charts, stacked line charts (area charts), plotter charts, bubble charts, and overlay charts. Most charts can be displayed in 2D or 3D.

3. How do I install EasyCharts?

Unzip the EasyCharts distribution file to your disk. You should now be able to test the chart demos opening the demo files with your web browser.

For applet use, copy the chart.jar file to the web directory where your file containing the applet will be, then set the applet tag to the following:

<applet code=com.objectplanet.chart.ChartApplet
archive=chart.jar width=300 height=200>
<param name="chart" value="bar">
</applet>

For java applications, import the chart.jar file into your development environment, or add the file to your CLASSPATH environment variable.

4. What is the licensing policy for EasyCharts?

You need one license for each developer using EasyCharts. If you have 2 people developing your application and one tester, you need three licenses. You need a source license for each person having access to the source code.

If you are developing an application for a client, you need to purchase a license on behalf of the client.

EasyCharts license agreement

5. Can EasyCharts be distributed without royalty fees?

Yes! The purchase of a developer kit includes a license to distribute the chart binaries without royalty fees as long as they are distributed as an integral part of your end user java or web application installed on a web server or client computer and executed solely on the client machine.

You must purchase valid development licenses for each developer working with EasyCharts.

If any EasyCharts software is executed on a server, you need to purchase a server installation license for each installation in addition to a developers kit that includes the software.

6. Which EasyCharts license(s) do I need?

If you are developing a commercial application using EasyCharts components, you need an EasyCharts Commercial Single-User Developer Kit or an EasyCharts Commercial Site Developer Kit. If your commercial application generates charts on the server side, you also need an EasyCharts Commercial Single-Server/World Wide Servlet Deployment license.

If you are developing an in-house application using EasyCharts components, you need an EasyCharts Single-User Developer Kit or an EasyCharts Site Developer Kit. If your in-house corporate application generates charts on the server side, you also need an EasyCharts Servlet Single-Server Deployment license or an EasyCharts Servlet Site Deployment license.

If you need access to the source code, you need the EasyCharts Commercial Source Code license or the EasyCharts Source Code license.

7. What does EasyCharts cost?

See the purchase page for detailed pricing info.

8. How do I purchase an EasyCharts license?

You can purchase the software online using a major credit card. Go to our purchase page for purchasing details and options.

9. How do I receive my purchased software?

An email with a download link is automatically sent after payment has been processed. This usually takes a few minutes.

10. Do you offer free upgrades?

Yes. An EasyCharts license comes with 1 year of free upgrades.

11. What kind of support do I get?

You get 1 year free email support. Email requests will usually be answered within a day.

12. Can I purchase the source code for EasyCharts?

Yes.

14. Which Java versions does EasyCharts support?

EasyCharts 3.5.1 and earlier (except 3.5) supports Java 1.1 or later. EasyCharts 4 requires Java 1.2 or later.

15. Which browsers and platforms does EasyCharts support?

EasyCharts works on browsers that support Java 1.1 or later such as Internet Explorer 3 or later and Netscape 3 or later.

16. How do I run examples from the examples directory?

To run the applet examples, open the index.html file in the examples directory. To run the java examples, call the runexample.bat in the examples/java directory followed with the name of the example. The example name is the same as the name of the java file but without any extension.


EasyCharts Features

17. Can I use EasyCharts with Swing?

Yes. Look here for an example.

18. Can the charts be used as applets?

Yes. Place the chart.jar file on your web server and use an applet tag like the following:

<applet code=com.objectplanet.chart.ChartApplet archive=chart.jar width=300 height=200>
<param name="chart" value="bar">
</applet>

<applet code=com.objectplanet.chart.ChartApplet archive=chart.jar width=300 height=200>
<param name="chart" value="pie">
</applet>

<applet code=com.objectplanet.chart.ChartApplet archive=chart.jar width=300 height=200>
<param name="chart" value="line">
</applet>

Make sure the chart.jar file is in the same directory as the file containing the applet.

19. Can I save the charts as images?

EasyCharts comes with a PngEncoder and JpegEncoder that you can use for saving the charts as images.

The following example shows how to use the JpegEncoder to generate jpeg images from the charts: SaveJpegChart.java.

20. Does EasyCharts support combination or overlay charts?

Yes. EasyCharts 2.5 or later can combine charts and chart types by laying one chart on top of the other.

Simple overlay example
Overlay with double range axis
Complex overlay example

21. Does EasyCharts support multiple y-axis?

Yes. EasyCharts version 2.5 or later supports multiple y-axis.

Bar chart with multiple y-axis

22. Does EasyCharts support data binding?

No. Data has to be passed into the charts using the applet parameters or the Java API. To retrieve data from a database, the data has to be read by a script on the server side, and a web page with the applet tag containing the data has to be dynamically built and then served to the client's web browser. You can also load data into the chart using the data parameter.

23. How do I load data into the charts?

For an applet, use the sampleValues_N parameter:

<applet code=com.objectplanet.chart.BarChartApplet archive=chart.jar width=300 height=200>
<param name=sampleValues_0 value="1,2,3,4,5">
</applet>

In a Java application, use the API methods:

BarChart chart = new BarChart();
double[] values = new double[] {1,2,3,4,5};
chart.setSampleCount(values.length);
chart.setSampleValues(0, values);

24. Can the charts be printed?

Use the browser's printing command. Use the printAsBitmap parameter to work around applet printing problems.

To print the charts correctly in a web page, they should be generated as images on the server side. You can use the ChartServlet that comes with EasyCharts 2.5 or later to do this.

To print in a Java application, use the printing capabilities of the standard Java API. Here is an example: PrintChart_JDK12.java

25. Does EasyCharts support pattern filling for black and white printouts?

Pattern filling is not supported. EasyCharts 3.0 and later supports various different line styles.

26. Does EasyCharts support multiline labels?

Yes, use \n in the labels where you want a line break.

<param name=chartTitle value="This is\nthe title">
// or in Java:
chart.setTitle("This is\nthe title");

Multiline chart title example

27. Does EasyCharts support angled labels?

Yes.

Angled bar labels
Angled axis labels
Angled bar value labels
Angled line value labels

28. Does EasyCharts support multiple data series?

Yes. With an applet, use the seriesCount parameter:

<applet code=com.objectplanet.chart.BarChartApplet archive=chart.jar width=300 height=200>
<param name=seriesCount value=3>
<param name=sampleValues_0 value="1,2,3,4,5">
<param name=sampleValues_1 value="3,4,5,6,7">
<param name=sampleValues_2 value="5,6,7,8,9">
</applet>

In a Java application:

BarChart chart = new BarChart();
chart.setSampleCount(5);
chart.setSeriesCount(3);
chart.setSampleValues(0, new double[] {1,2,3,4,5});
chart.setSampleValues(1, new double[] {3,4,5,6,7});
chart.setSampleValues(2, new double[] {5,6,7,8,9});

Bar chart with multiple series
Line chart with multiple series
Pie chart with multiple series

29. Can I make stacked bar charts or stacked line charts/area charts?

Yes. For a bar chart applet:

<param name=seriesCount value=3>
<param name=sampleValues_0 value="1,2,3,4,5">
<param name=sampleValues_1 value="3,4,5,6,7">
<param name=sampleValues_2 value="5,6,7,8,9">
<param name=barType value=stacked>

In Java: chart.setBarType(BarChart.STACKED_BARS);

Stacked bars example

For a line chart applet:

<param name=seriesCount value=3>
<param name=sampleValues_0 value="1,2,3,4,5">
<param name=sampleValues_1 value="3,4,5,6,7">
<param name=sampleValues_2 value="5,6,7,8,9">
<param name=stackedOn value=true>

In Java: chart.setStackedOn(true);

Stacked lines example

30. Can I make drilldown charts?

Yes. You can associate a URL with every sample or series in the chart applets by using the url_N_M and urltarget_N_M parameters. The URL can then be pointed to another chart containing the drill down data. See here for details.

31. Can I control the fonts and colors of the charts?

Yes. You can set the font type and font size of all labels, you can set the chart foreground and background colors, and you can set the color of each sample in the chart.

Chart color examples
Chart label colors

32. Does EasyCharts support Servlets or Java Server Pages?

Yes, EasyCharts 2.5 comes with a generic ChartServlet that generates the charts as JPEG images.

33. How do I access EasyCharts as a servlet?

Install a web server or application server that supports Java Servlets or JavaServer Pages. You can find the Tomcat server here. Follow the installation instructions that come with the distribution.

Then add the chartServer.jar file to your CLASSPATH or application server. After adding to the path, start your server.

You can now access the servlet using a standard HTML image tag:

<img src="http://server:8080/servlet/com.objectplanet.chart.ChartServlet?
chart=bar&width=200&height=100&rangeStep=10&
sampleValues=32,87,46,29,36,45,92,76,34,59,27,63,45">

34. Can I control the charts using JavaScript?

Yes. Look at this example.

35. Can I do plotter charts?

Yes. EasyCharts 3.0 and later supports plotter and bubble charts.

36. How do I display floating point data?

For a bar and line chart applet, use the following two parameters:

<param name=sampleDecimalCount value=3>
<param name=rangeDecimalCount value=2>

For a pie chart applet:

<param name=sampleDecimalCount value=1>
<param name=percentDecimalCount value=1>

Add floating point data using the sampleValues parameter:

<param name=sampleValues value="1.242, 4.1224, 5.1212, 6.231">

In a Java application:

chart.setSampleDecimalCount(2);
chart.setRangeDecimalCount(2);

37. Does EasyCharts support copy & paste?

No.

38. How do I display tool-tip like labels?

For the bar chart applet:

<param name="valueLabelStyle" value="floating">
<param name="sampleLabelStyle" value="floating">

In a Java application:

setValueLabelStyle(Chart.FLOATING);
setSampleLabelStyle(Chart.FLOATING);

The labels in the pie chart are floating by default.

39. How do I avoid flickering of the charts when they repaint?

In a Java application, use the NonFlickerPanel class supplied by EasyCharts:

BarChart chart = new BarChart();
// set the chart data...
NonFlickerPanel p = new NonFlickerPanel(new BorderLayout());
p.add("Center", chart);
Frame f = new Frame();
f.add("Center", p);
f.setSize(300,200);
f.show();

40. Does the line chart support different line types?

Yes. EasyCharts 3.0 and later supports various different line styles.

41. How do I associate a URL with a chart sample?

Use the url parameter:

<param name="url_0" value="orange_sales_1999.html">
<param name="url_1" value="apple_sales_1999.html">
<param name="url_2" value="banana_sales_1999.html">
<param name="url_3" value="http://www.objectplanet.com">

Since Java can only call valid URL links, JavaScript functions cannot be called using the url parameters. Netscape comes with something called JSObject which can be used. See here for instructions.

42. How do I associate a URL with a chart sample for the ChartServlet (servlet drilldown)?

This can only be done if your application server supports server-side includes or if you are using a scripting language such as JSP. You can use servlet drilldowns by specifying the url_N parameter.

With server-side includes:

<servlet code=com.objectplanet.chart.ChartServlet>
<param name=chart value=bar>
<param name=sampleValue value=10,20,30>
<param name=url_0 value=page_one.html>
<param name=url_1 value=page_two.html>
<param name=url_2 value=page_three.html>
</servlet>

With JSP:

<jsp:include page="http://127.0.0.1:8080/servlet/com.objectplanet.chart.ChartServlet?
chart=bar&sampleValues=10,20,30&url_0=page_one.html&url_1=page_two.html&url_2=page_three.html" flush="true"/>

The returned content is an HTML imagemap and image tag pointing to the ChartServlet.

43. What is the download time of the chart applets?

The size of the chart.jar file is approximately 140KB and will take a second or two to download. Then the browser will take a second or two to initialize the applet.

45. Can EasyCharts display Japanese characters?

Yes, see example.


Problems & Issues

46. Why do the chart applets have problems repainting when I scroll the web page?

Some browsers have problems repainting complex Java applets. Use the automaticRefreshTime parameter to work around this problem. This parameter makes the applet repaint itself every n milliseconds:

<param name="automaticRefreshTime" value=1000>

47. Why do I have problems printing the charts in Netscape?

In earlier versions, Netscape did not support printing of Java applets. In later versions it supports printing, but the applets are always printed relatively larger than they appear on the screen. The workaround is to use another browser or have the charts generated as images on the server.

48. Why does Netscape Communicator freeze when accessing a web page with charts?

This is a known bug in Netscape Communicator and may also occur when using other applets. You can find a description and solution here.

49. How do I remove the red evaluation button and copyright banner?

Purchase a valid license from our EasyCharts page, download the registered software, and replace the evaluation version. Then restart your web browser.

If the red button is still displayed, you might have old evaluation classes loading from elsewhere on your system. To check, remove the archive=chart.jar tag from your applet tag, close and restart your browser and test again. The applet should not start. If it does, remove any com/objectplanet/chart classes (or chart.jar) from your CLASSPATH environment variable.

51. How do I use EasyCharts on Unix without X-Windows installed?

Java's AWT needs an underlying graphical architecture such as X-Windows to work. A servlet executed on a Unix server without X installed or running will throw an exception.

If you want to run ChartServlet on a Linux computer without X-Windows, you can use one of the following options:

1. Use EasyCharts 3.0 and J2SE 1.4.0 or higher.
2. Install Xvfb — a virtual X server which can run on machines without display hardware.
3. Install PJA — Pure Java AWT replacement library.

EasyCharts 3.0 and J2SE 1.4.0: The following property may be specified at the Java command line:

-Djava.awt.headless=true

In tomcat.sh, change:

JAVACMD=$JAVA_HOME/bin/java

to:

JAVACMD="$JAVA_HOME/bin/java -Djava.awt.headless=true"

Note: If you are not using ChartServlet but your own servlet, create the image as:

Image image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
Graphics2D g2D = (Graphics2D)image.getGraphics();
if (g2D != null) {
    chart.paint(g2D);
}

For more info about Java headless support see the Java documentation.

XVFB: You can get Xvfb for Linux from ftp.xfree86.org. Install it, run ./Xvfb :0, and set the DISPLAY variable to localhost:0.

PJA: See the PJA documentation for full setup instructions with Tomcat.

52. Why does my web server report 404 errors on BeanInfo.class files?

See Microsoft Knowledge Base article Q243771.