EasyCharts Basics:
1. What is EasyCharts?
17. Can I use EasyCharts with Swing?
44. Why do the chart applets have problems repainting when I scroll the web page?
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), and overlay
charts. All 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.BarChartApplet 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 polisy 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 royaltee fees?
Yes! The purchase of a developer kit, includes a license to distribute the
chart binaries without royaltee 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 want to use EasyCharts as applets or in java applications without
modifications the EasyCharts binary developers kit should cover your need.
If you want to use EasyCharts in java applications and modify the charts
in any way you need to purchase the EasyCharts source developers kit.
If you want to execute any EasyCharts software on a server such as running it
as a servlet generating images of the charts, you need to purchase one
EasyCharts server installation license per server in addition to any of the
above two licenses.
7. What does EasyCharts cost?
That depends on the license you purchase.
See here
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. The email requests will usually be
answered within a day.
12. Can I purchase the source code for EasyCharts?
Yes. One of the license options comes with the full source code.
13. What is the difference between EasyCharts and ObjectPlanet's Bar/Line/PieChartApplet
EasyCharts is a complete java chart library that includes components with
a full java API to be used in java applications, applets to be used
in web pages, and a servlet to generate charts as jpeg images.
The applets found at
http://objectplanet.com/comp/BarChartApplet,
http://objectplanet.com/comp/PieChartApplet, and
http://objectplanet.com/comp/LineChartApplet
are optimised for applet use and has a smaller footprint and better
compatibility than the applets in EasyCharts.
However, these standalone applets do not support all features found
in EasyCharts.
14. Which java versions does EasyCharts support?
EasyCharts supports JDK 1.1 or higher.
15. Which browsers and platforms does EasyCharts support?
EasyCharts works on browsers that supports JDK 1.02 or later such as
Internet Explorer 3 or later and Netscape 3 or later.
16. How do I run examples from the examples directory?
There is a file called runexample.bat in the examples directory.
To run an example type runexample example_name.
17. Can I use EasyCharts with Swing?
Yes. Look here
for an example.
18. Can the charts be used as applets?
Yes. Use the BarChartApplet, PieChartApplet, and LineChartApplet with an
applet tag like the following:
<applet code=com.objectplanet.chart.BarChartApplet
Make sure the chart.jar file is in the same directory as the file containing
the applet.
19. Can I save the charts as gif or jpeg images?
EasyCharts comes with a JpegEncoder that you can use for saving the charts
as jpeg images.
The following example shows you have to use the JpegEncoder
to generate jpeg images from the charts.
SaveJpegChart.java.
You can also use other image encoders (such as the
Acme GifEncoder)
to generate charts with other image formats.
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 examples
21. Does EasyCharts support multiple y-axis?
Yes. EasyCharts version 2.5 or later supports double y-axis.
22. Does EasyCharts support data binding?
EasyCharts can not connect directly to a data source and load data. The
data must be passed in throught the Java API, the applet parameters,
or read from a URL.
To retrieve data from a database, the data has to be read by a script on the
server side which constructs the applet tag, or serves the data to an
applet using the <param name=data value=url> parameter.
23. How do I load data into the charts?
For an applet use the sampleValues_N parameter:
<applet code=com.objectplanet.chart.BarChartApplet
Or use the data parameter loading the data from a URL:
<applet code=com.objectplanet.chart.BarChartApplet
The URL must return the data in the following format
parameter=value
In a java application, use the API methods:
BarChart chart = new BarChart();
A servlet can either load the data directly in the URL or image tag
<img src="http://localhost:8080/servlet/com.objectplanet.chart.ChartServlet?
Or you can use the data parameter, loading the data from a URL.
<img src="http://localhost:8080/servlet/com.objectplanet.chart.ChartServlet?
24. Can the charts be printed?
Yes. For an applet, use the browsers printing command. However there are a
few problems: 1) In Netscape the applets are printed larger than they appear
on the screen. 2) In Internet Explorer 4.0 or older, if you change the chart
applet's data using JavaScript during runtime, the changed data will not
print, only the original applet from the web page (IE reads the page again
before printing). 3) Internet Explorer 5 or later on Windows 2000 does
not print applets very well (often only black thin lines, no colors).
Use the
printAsBitmap parameter to work around this problem.
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.java
25. Does EasyCharts support pattern filling for black and white printouts?
No. Due to the charts being based on JDK 1.02 and JDK 1.1 they do not support
pattern filling or 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">
27. Does EasyCharts support angled labels?
Yes.
angled bar labels
28. Does EasyCharts support multiple data series?
Yes. With an applet, use the seriesCount parameter:
<applet code=com.objectplanet.chart.BarChartApplet
In a java application, do the following:
BarChart chart = new BarChart();
bar chart with multiple series
29. Can I make stacked bar charts or stacked line charts/area charts?
Yes. For a bar chart applet, do the following.
<applet code=com.objectplanet.chart.BarChartApplet
In java, do the following:
chart.setBarType(BarChart.STACKED_BARS);
For a line chart applet, do the following.
<applet code=com.objectplanet.chart.LineChartApplet
In java, do the following:
chart.setStackedOn(true);
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
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(tm) Servlets or
JavaServer Pages(tm). You can find the Tomcat server
here.
Follow the installation instructions that comes with the distribution.
Then add the chartServer.jar file to your CLASSPATH or application server.
After added 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?
34. Can I control the charts using JavaScript?
Yes. Look at this example
35. Can I do plotter charts?
Yes and no. In the current version you can not plot x/y values directly.
You can however turn on sample highlight points on the lines, and turn off
the lines to display points only.
<param name="sampleHighlightOn" value="true">
A true plotter chart will be added in later versions.
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>
For a pie chart applet, use the following two parameters
<param name=sampleDecimalCount 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, do the following:
chart.setSampleDecimalCount(2);
37. Does EasyCharts support copy & paste?
No. Due to EasyCharts being based on JDK 1.02 and JDK 1.1, copy & paste
is not supported.
38. How do I display tool-tip like labels?
For the bar chart applet, do the following:
<param name="valueLabelStyle" value="floating">
In an java application call the following methods:
setValueLabelStyle(BarChart.VALUE_LABELS_FLOATING);
The labels in the pie chart is floating by default. The line chart does not
support floating labels in the current version.
floating bar sample labels
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();
40. Does the line chart support different line types?
No. Due to the charts being based on JDK 1.02 and JDK 1.1 they do
not support 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">
Since Java can only call valid URL links, JavaScript functions can
not be called using the url parameters. Netscape comes with something called
JSObject which can be used. See
here
for instructions.
42. What is the download time of the chart applets?
The size of the chart.jar file is approx. 80KB and will take about 12-15
seconds on a 56K modem. On a LAN it takes less than 1 second to
load the chart classes.
43. Can EasyCharts display Japanese characters?
Yes, see example.
44. Why do the chart applets have problems repainting when I scroll the web page?
Some browsers has 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>
45. 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. We have not found a
workaround for this other than to use another browser or have the charts
generated as images on the server.
46. Why does Netscape Communicator freeze when accessing a web page with charts?
This is a known bug in Netscape Communicator an it may also occure when using
other applets. You can find description and solution of the problem
here.
47. How do I remove the red evaluation button and copyright banner?
Purchase a valid license from our
purchase page,
download the registered software, and replace the evaluation version. Then
restart your web browser.
If you still have the red button displayed, you might have some old evaluation
classes loading from elsewhere on your systems. To check for this, 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, you need
to remove any com/objectplanet/chart classes (or chart.jar) files from
your CLASSPATH environment variable.
If it still does not work, restart your web server and or client machine.
Also try and test with other client machines connecting to your
web server (if you are running as an applet).
48. I am having problems with Mac/Netscape. How do I fix it?
You need to download the MacOS Runtime for Java (MRJ) Plug-In for Netscape,
and then enable it in your browser. You can find details and links to the
downloads here
49. How do I use EasyCharts on Unix without X-Windows installed?
Java's AWT (graphical system) needs an underlaying 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 installed you have two options:
1. Xvfb
1. Install Xvfb in a directory on your linux computer
The Xvfb should now be installed properly. You can now run EasyChart's
ChartServlet on a headless Linux server.
For more information about Xvfb check http://www.xfree86.org/4.0.1/Xvfb.1.html
2. PJA
Assuming
2. What chart types do EasyCharts support?
3. How do I install EasyCharts?
4. What is the licensing polisy for EasyCharts?
5. Can EasyCharts be distributed without royaltee fees?
6. Which EasyCharts license(s) do I need?
7. What does EasyCharts cost?
8. How do I purchase an EasyCharts license?
9. How do I receive my purchased software?
10. Do you offer free upgrades?
11. What kind of support do I get?
12. Can I purchase the source code for EasyCharts?
13. What is the difference between EasyCharts and ObjectPlanet's Bar/Line/PieChartApplet
14. Which java versions does EasyCharts support?
15. Which browsers and platforms does EasyCharts support?
16. How do I run examples from the examples directory?
EasyCharts features:
18. Can the charts be used as applets?
19. Can I save the charts as gif or jpeg images?
20. Does EasyCharts support combination or overlay charts?
21. Does EasyCharts support multiple x- and y-axis?
22. Does EasyCharts support data binding?
23. How do I load data into the charts?
24. Can the charts be printed?
25. Does EasyCharts support pattern filling for black and white printouts?
26. Does EasyCharts support multiline labels?
27. Does EasyCharts support angled labels?
28. Does EasyCharts support multiple data series?
29. Can I make stacked bar charts or stacked line charts/area charts?
30. Can I make drilldown charts?
31. Can I control the fonts and colors of the charts?
32. Does EasyCharts support Servlets or Java Server Pages?
33. How do I access EasyCharts as a servlet?
34. Can I control the charts using JavaScript?
35. Can I do plotter charts?
36. How do I display floating point data?
37. Does EasyCharts support copy & paste?
38. How do I display tool-tip like labels?
39. How do I avoid flickering of the charts when they repaint?
40. Does the line chart support different line types?
41. How do I associate a URL with a chart sample?
42. What is the download time of the chart applets?
43. Can EasyCharts display Japanese characters?
EasyCharts problems and issues:
45. Why do I have problems printing the charts in Netscape?
46. Why does Netscape Communicator freeze when accessing a web page with charts?
47. How do I remove the red evaluation button and copyright banner?
48. I am having problems with Mac/Netscape. How do I fix it?
49. How do I use EasyCharts on Unix without X-Windows installed?
archive=chart.jar width=300 height=200>
</applet>
server license agreement
Note: Example name is the same as the name of the java file but
without any extension.
archive=chart.jar width=300 height=200>
</applet>
SaveGifChart.java.
overlay with double range axis
complex overlay example
archive=chart.jar width=300 height=200>
<param name=sampleValues_0 value="1,2,3,4,5">
</applet>
archive=chart.jar width=300 height=200>
<param name=data value=url>
</applet>
parameter=value
parameter=value
double[] values = new double[] {1,2,3,4,5};
chart.setSampleCount(values.length);
chart.setSampleValues(0, values);
sampleValues=1,2,3,4,5
">
data=http://localhost/mydata.asp
">
or
chart.setTitle("This is\nthe title");
angled axis labels
angled bar value labels
angled line value labels
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>
chart.setSampleCount(5);
chart.setSeriesCount(3);
double[] values0 = new double[] {1,2,3,4,5};
double[] values1 = new double[] {3,4,5,6,7};
double[] values2 = new double[] {5,6,7,8,9};
chart.setSampleValues(0, values0);
chart.setSampleValues(1, values1);
chart.setSampleValues(2, values2);
line chart with multiple series
pie chart with multiple series
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">
<param name=barType value=stacked>
</applet>
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">
<param name=stackedOn value=true>
</applet>
chart label colors
chart=bar&
width=200&height=100&
rangeStep=10&
sampleValues=32,87,46,29,36,45,92,76,34,59,27,63,45">
<param name="sampleHighlightStyle" value="circle">
<param name="seriesLineOff" value=true>
<param name=rangeDecimalCount value=2>
<param name=percentDecimalCount value=1>
chart.setRangeDecimalCount(2);
<param name="barLabelStyle" value="floating">
setBarLabelStyle(BarChart.BAR_LABELS_FLOATING);
floating bar value labels
// set the chart data
// ...
// add the chart in the NonFlickerPanel
NonFlickerPanel p = new NonFlickerPanel(new BorderLayout());
p.add("Center", chart);
// display the chart
Frame f = new Frame();
f.add("Center", p);
f.setSize(300,200);
f.show();
<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">
Xvfb is a virtual X server which can run on machines without a display
or physical graphical device.
You can get Xvfb for Linux from
ftp.xfree86.org.
Distributions for other Unix systems can also be found at ftp.xfree86.org.
You can also get Xvfb source at ftp.x.org and compile it.
2. Run Xvfb by typing in ./Xvfb :0 where 0 is the X-windows display number.
3. Set the DISPLAY variable to point to localhost:0
Pure Java AWT replacement library.
- Java is installed into: /usr/local/jdk1.2.2
- Tomcat is installed into: /home/user/tomcat
- PJA is installed into: /home/user/pja
java -Xbootclasspath/a:../lib/pja.jar \
-Dawt.toolkit=com.eteks.awt.PJAToolkit \
-Djava.awt.graphicsenv=com.eteks.java2d.PJAGraphicsEnvironment \
-Djava2d.font.usePlatformFont=false
-Djava.awt.fonts=/usr/local/jdk1.2.2/jre/lib/fonts \
-Duser.home=.. \
-classpath ../lib/pjatools.jar \
ToolkitDemo
If you see that 4 gifs were generated, it means that you can use graphic servlets
on this server with PJA.
JAVACMD="$JAVA_HOME/bin/java.
Replace it with
JAVACMD="$JAVA_HOME/bin/java -Xbootclasspath/a:/home/user/pja/lib/pja.jar -Dawt.toolkit=com.eteks.awt.PJAToolkit -Djava.awt.graphicsenv=com.eteks.java2d.PJAGraphicsEnvironment -Djava2d.font.usePlatformFont=false -Djava.awt.fonts=/usr/local/java/jre/lib/fonts -Duser.home=home/user/pja"
and next to it add
CLASSPATH=${CLASSPATH}:/path_to_chartServer.jar/chartServer.jar
A chart image should be returned to your browser now.
Copyright (C) 1998-2003
ObjectPlanet, Inc.
(+47) 2233 3360
mail@objectplanet.com