Quadbase / Support / FAQs / EspressChart Tech Support FAQ

Quadbase

EspressChart Tech Support FAQ

INSTALLATION ISSUES

  1. EspressChart fails to install in Solaris or PC
  2. Why do I have no class found error on JVM installation
  3. Login applet is blank on my browser, with init applet can't start
  4. EspressManager cannot start
  5. I do not have a Web server on my machine
  6. Cannot login to Solaris java.io.FileNotFoundException
  7. Solaris displayed no login applet, and API examples hAng
  8. Does Oracle 9iAS, IBM AS400, RS6000 and other models work with EspressChart and its servlets? Does it connects to DB2?
  9. What should I do if I failed to register license in the EC installation?
  10. How to move a licensed EC from one machine to another?

RUNNING ESPRESSCHART

  1. I get the message 'Failed to login, can't contact EspressManager at ....'
  2. I get the message 'Failed to login: cannot connect to EspressManager at localhost'
  3. I get the message 'Failed to connect to database ... data source name not found'
  4. I get the message 'Failed to connect to database sun/jdbc/odbc/JdbcOdbcDriver'
  5. Do I need to start EspressManager on a client machine?
  6. What Java version can I use with EspressChart?
  7. A Data Registry issue with Java8.
  8. What file paths should I use?
  9. Why Auto Scaling does not work if all input data are between 0.0 and 0.99?
  10. After Chart Designer obtains data from database successfully, it gives a 'java.lang.IllegalArgumentException: No numeric data to plot' error while creating chart.
  11. When I ran Chart Gallery from www.quadbase.com, I got Failed to load data from file java.netNoRouteToHostException.
  12. EspressChart does not work with my JDBC driver
  13. Is EspressChart written in 100% pure Java?
  14. How can I get rid of the small label 'Quadbase Systems Evaluation Copy only' in the lower section of chart?
  15. The image does not appear for the url in the image dialog box
  16. The background image doesn't appear after I have moved my .cht file from one server to another
  17. How can I print the charts produced by EspressChart?
  18. When I publish the chart on the web using Chart Viewer, the remote users get an error message 'Class Not found'
  19. How can I set other parameters such as font, color, background, etc. in Chart Viewer?
  20. What is the difference between the .pac, .tpl and .cht file formats?
  21. How do I set additional classpath (e.g. jdbc driver) when start as a service in NT?
  22. I get an exception 'Out of Memory'
  23. The labels in the X-axis are too dense  i.e., the labels are overlapping each other.  How do I make it look better ?
  24. Are there any limitations on the length and type of characters in labels?
  25. The x/y grid in the chart is too dense.
  26. How can I change the Line Chart  so that it will not draw at the origin?
  27. Why does some of the text I add shift after the chart export?
  28. How do I remove the log file for EspressEspressManager?
  29. Why do the constructors for QbChart take Applet or Frame parameters? What info does it take from those params?
  30. The color of the output reduced to 256 when I export in Chart Designer even though my graphics display supports true color.
  31. The scroll bar is very annoying! How can I get rid of it?
  32. I don't like the current chart size. Can I make it bigger?
  33. Why does my browser say that it cannot find the quadbase.chartViewer.Viewer.class even though my classpath is set to the root EspressChart directory when I create a HTML file to view a .cht file through the Chart Viewer?
  34. How to solve the problem that EspressChart.jnlp launches then disappears at once on Windows 10 with JRE 10?

SOLARIS / UNIX / lINUX ISSUES

  1. When we tried using Espresschart on a simple telnet session (rather than XTerm) it gives us an error (some X11 windows error) ?
  2. When running EspressChart remotely to a Unix server (e.g. Solaris) without a display card, it gives us a 'quadbase.chart.C-string class not found error' or 'X11 not found error' when connecting to oracle database?
  3. When we execute servlet using API in EspressChart it gives us a 'java.lang.NoClassDefFoundError quadbase/chart/C-string'
  4. After X11R6 (Xvfb) started, EspressChart still gives 'quadbase/chart/C-string not found error'
  5. Are there alternatives to X-windows display and Xvfb?
  6. Commands to run X server in background for Sun / Unix

FEATURES AND ENHANCEMETS

  1. Does EspressChart support stored procedures?
  2. Does EspressChart support parameterized queries?
  3. Does EspressChart support object-oriented databases as well as SQL?
  4. Does EspressChart support real time data fetching from a database when Chart Viewer is loaded?
  5. Can I schedule Chart Viewer to refresh itself from a database after a specified time interval?
  6. Can I get data from my own datasource and push the data to chart viewer to update it continuously?
  7. Do I need to know programming or complicated EspressChart applet parameters in order to publish my own charts on the web?
  8. How can I specify to use EspressManager in different machine instead of the one in Web server?
  9. Can I save or export the chart to the client machine instead of to the server machine?
  10. Does EspressChart support JavaBeans?
  11. Can I export a chart in other formats?
  12. Does EspressChart support image maps?
  13. Is it necessary to install the classpath of EspressChart in the web server machine?
  14. Can we pass data directly to the chart Viewer in the html page?
  15. How can I change the default port number of EspressChart?
  16. Can EspressChart support different date/time formats?'
  17. Where can I found documentation on NumericFormat, DateTimeFormat, LogicalFormat ?
  18. Why is the Trend Line missing in some charts?
  19. Parameterized query not working with error message 'Service does not support parameterized query'

API-RELATED QUESTIONS

  1. When using the API I got message 'Failed to read server.cfg, use default host and port no 22071'
  2. Can the Chart API do without the EspressManager?
  3. Where can I find more API examples?
  4. The jar files are too big. Can they be smaller?
  5. How can I put the chart at the center of the canvas?
  6. Where is the API information on data transpose?

HOW TO USE THE API/SERVLETS

  1. How do I specify the column mappings for the chart?
  2. How do I set the decimal point and remove the thousand seperator?
  3. How do I set the chart so that it cannot be dragged or resized?
  4. How do I change the scale of an axis?
  5. How do I swap the primary and secondary axis and how do I specify the chart type for the secondary axis?
  6. How do I change the font settings for the labels, titles, etc. ?
  7. How do I explicitly set the color for the series or categories (if no series are specified)?
  8. How do I change the Origin of the chart i.e., where the x-axis and y-axis intersect?
  9. How do I set it up so that the navigation panel does not show up when a 3d chart is shown and disable the toggling?
  10. How do I set it up so that the chart is always displayed without any need for scroll bars?
  11. How do I write an application to export a chart in GIF/JPEG form without using EspressManager?
  12. How do I use a servlet to export a chart in GIF/JPEG form to browsers?
  13. How do I read null data in EspressAPI to replace 0 value for the purpose of eliminating colored line in stackcolumn chart?
  14. How do I make Chart Legend square with ChartAPI?

EspressChart fails to install in Solaris or PC

The most common problem is out of disk space. If you have an older version of EspressChart, please stop the EspressManager in the service control panel before installation. For newer version of EspressChart, please unzip the downloaded zip file, and run the class file inside with your Java Virtual Machine. You must have about 125MB of free disk space before install. This free space should be in ./var/tmp directory in Solaris if espresschart.sh is in the same tmp directory.

Why do I have no class found error on JVM installation?

You need to recheck spelling and use all-lower-case for espresschart.

Login applet is blank on my browser with init applet can't start message

Your browser may not support jdk1.5, or JVM not turned on. Please check your browser against www.quadbase.com live-demo link to see whether the same problem occurs.

EspressManager cannot start

Please go to command prompt and start your espressmanager.bat there. Check the error messages and set proper path or classpath on your computer.

I do not have a Web server on my machine

You may install EspressChart anywhere, and use designer.bat to run EspressChart as an application. You may not use the browser to run espresschart if you are running without a Web Server.

Cannot login to Solaris java.io.FileNotFoundException

File protection on EspressChart folder and its subdirectories has to be removed after installation on a Solaris machine.

Solaris displayed no login applet, and API examples hung

Run appletviewer example1.html produced 'cannot convert string error', indicated jdk problems on Solaris.

Does Oracle 9iAS, IBM AS400, RS6000 and other models work with EspressChart and its servlets? Does it connect to DB2?

EspressChart was successfully tested and deployed on IBM AS400 and RS6000 models with Web Sphere server. A graphic card or Xvfb is required on AS400 for the EspressChart-associated servlets to run. You need to install EspressChart with java instead of jview for the DB2 database connection to work. Oracle 9iAS Application Server requires CLASSPATH settings in XML files for the servlets to work.

What should I do if I failed to register license in the EC installation?
In EC installation, if you failed to register license, you can go to http://www.quadbase.com/license-registration-1/ to get a new qblicense.jar, , copy the new jar file and replace the original one in <EC>/lib/ directory.

How to move a licensed EC from one machine to another?

If you want to move a licensed EC from one machine to another, you may re-use the same license key by the following procedure, as an example.
(1) On Windows machine that has installed the licensed version, go to <EC installed directory>UninstallerDataUninstall_EspressChart.exe and run it by double clicking from Windows Explorer Or you may use the Windows shortcut, Start /All Programs / EspressChart /Uninstall EspressChart
(2) Move InstallEC66.exe to another machine and use the same license key again.
(3) The above procedure also works on non-Windows machine where you should use a Command Prompt and run the corresponding file in the UninstallerData directory.

I get the message 'Failed to login, can't contact server at ....'

Check whether you have started EspressManager. You may start EspressManager either as an application (run espressmanager.bat which is in the EspressChart directory), or under Windows you can start EspressManager as a service (select Services in the Control Panel and start EspressManager).

I get the message 'Failed to login: cannot connect to EspressManager at localhost'

This is a security exception, thrown by IE and some Netscape browsers. Essentially, the browsers do not allow applets to connect to the local machine(designated by 127.0.0.1).  Please go to EspressChart/userdb directory and edit config.txt to add an IP address after the port number..

*Before Editing*

[port]
22071

*After Editing*

[port]
22071, 204.147.182.33

Note:- Substitute the IP address of the machine running the EspressManager for 204.147.182.33. Restart the EspressManager and you should be able to run Chart Designer through a browser.

In addition, there is also a batch file (Designer.bat) that runs Chart Designer as an application. If connection through a browser is not possible, please try running the batch file.

I get the message 'Failed to connect to database ... data source name not found'

The database to which you are trying to connect has not been registered as a System Data Source (not User Data Source) on the system that EspressManager is located (not the client machine) or you have mistyped its name.

I get the message 'Failed to connect to database sun/jdbc/odbc/JdbcOdbcDriver'

You need to change ODBC driver from Sun to Microsoft. This is accomplished by replacing in the Driver window sun.jdbc.odbc.JdbcOdbcDriver by com.ms.jdbc.odbc.JdbcOdbc Driver.

Do I need to start EspressManager on each client machine?

No, you only need to start EspressManager on your web server machine. You need to buy additional license in order to run EspressManager on more than one web server machine.

What Java version can I use with EspressChart?

EspressChart supports any Java version the equilivent of Oracle's JDK 1.5 and higher.  Specifically ported JVMs include Sun, IBM, and BEA.  Note that the applet viewers require the Java plug-in to be installed in the client browser.

A Data Regsitry issue with Java8.

Java8 has stopped supporting jdbc-odbc bridge connection. The ODBC Datasource connection in DataRegistry is still working with lower versions of java such as Java7 but not Java8. Available workaround must be used for ODBC connection to Access database if Java8 were used.

What file paths should I use?

The filename can be entered in one of two ways:

  • Give the full path of the file including drive (e.g.. c:/Program Files/EspressChart/help/examples/data/sample.dat).
  • Give the relative path of the file from the EspressChart root directory (e.g.. help/examples/data/sample.dat).

Why Auto Scaling does not work if all input data are between 0.0 and 0.99?

In Chart Designer, go to Format -> Axis Elements / YAxis / Fixed point and set the decimal points to 2 places in the pop-up window. You can also go to Format -> Axis Elements by clicking on Format Value Elements icon in the toolbar.

In API, add the following section:

/*---NUMBER FORMATING- For automatic scaling of data less than 1*/
NumericFormat numericFormat = new NumericFormat();
numericFormat.decimal=2;
hYAxis.gethLabel().setFormat(numericFormat);

After Chart Designer obtains data from database successfully, it gives a 'java.lang.IllegalArgumentException: No numeric data to plot' error while creating chart.

A column of numeric data (double, integer, or decimal) is required to create chart. As an example, oracle stores its numeric data as string and needs to be restored using the query to numeric data type before charting. The same error occurs, if all the data are numbers and select COL chart.

When I ran Chart Gallery from www.quadbase.com, I got Failed to load data from file java.netNoRouteToHostException.

Are you behind a firewall? The EspressManager running on Quadbase Web site requires a connection on port 8080. It looks like you are not able to connect to that port because of a firewall. Please download the evaluation version and install it on your local machine. You can access the same Chart Gallery there.

Chart does not work with my JDBC driver

Modify EspressManager.bat to include the JDBC driver in the classpath and restart EspressManager.

If this does not work, please test your JDBC driver using bridgeTest/test.bat (after modifying test.bat to include the classpath of your JDBC driver). The test can be performed by modifying test.bat to include the JDBC driver file and modifying info.txt to include the database details. If the test fails please hand the code bridgeTest/TestDB.java to your JDBC driver vendor to investigate.

Is EspressChart written in 100% pure Java?

Yes, Chart Viewer, Chart Designer, Chart API, and even EspressManager are all written in 100% pure Java. EspressChart has been tested to work well with Internet Explorer 6+, Safari, Firefox and Chrome browsers.

How can I get rid of the small label 'Quadbase Systems Evaluation Copy only' in the lower section of my charts?

The label is removed in the purchased version of EspressChart. If you have purchased EspressChart and the watermark didn't go away, please contact our support.

The image does not appear for the URL in the image dialog box

Please note that you cannot specify an image from a machine other than the one on which Chart Designer is loaded, due to an applet security restriction.

The background image does not appear after I move my .cht or .tpl file from one server to another

Save the chart as .pac and the background image will be added to the file automatically allowing you to easily move/archive the chart.

If you really want to use .tpl or .cht files, you need to copy the background image to the new server also. If the url is http://oldmachine/path1/path2/test.gif then Chart Viewer will find the new background image from http://newmachine/path1/path2/test.gif

How can I print the charts produced by EspressChart?

You can write a simple API program as shown in Example 9 to export the chart in a gif/JPEG file using the EspressManager and spawn a browser to load the image back (you may need to press the reload button of the browser to load the new image) and print it.

When I publish the chart on the Web using Chart Viewer, the remote users get an error message 'Class Not found'

You need to copy the archive files EspressViewer.cab, EspressViewer.jar, EspressViewer.zip to your web server and include them in your html page as shown below:

<SCRIPT LANGUAGE=JavaScript>
<!-- document.write('
<applet code="quadbase.chartViewer.Viewer.class" width=600 height=450
archive="EspressViewer.' + (parseInt(navigator.appVersion)> 
< 4 ? 'zip' : 'jar')); document.write('">
<PARAM name="cabbase" value="EspressViewer.cab"> 
<PARAM name="filename" value="yourchart.cht">
</applet>'); //-->
</script> 

 How can I set other parameters such as font, color, background, etc. in Chart Viewer?

You can design all the attributes in Chart Designer and save it in template format (.tpl), say mytemplate.tpl. Then in the Chart Viewer add one more parameter

<PARAM name="filename" value="mytemplate.tpl">

This template which contains more than 200 attributes will apply to the current chart.

What is the difference between the .pac, .tpl and .cht file formats?

A .pac file contains everything (except for data source) that the chart needs including it's data, background images etc. A .cht file also contains the actual data to plot which .tpl does not. All three file formats contain the data source information which can be used to schedule the data to reload from database. For a .cht and .pac file it contains data to plot so the chart look the same every time it is loaded. For .tpl file it fetches the updated data from database every time it is loaded so it takes longer time for it to appear and the chart may look different from time to time.

How do I set additional classpath (e.g. jdbc driver) when start as a service in NT?

Please edit and remove all the -cp items in espresschartserviceschserver.ini file, and put them with added zip or jar files, in controlPanelsystemenvironment as a system classpath. All the zip and jar files must be added to CLASSPATH in one command line.

I got an Exception 'Out of Memory'

This indicates that either the Chart Designer or EspressManager has run out of memory. To increase the memory for either component, modify EspressManager.bat, designer.bat generated by the installation and substitute the following argument -Xmx128M before the '-classpath' argument, to '-Xmx256M', will increase the heap size of the Java process to 256 megabytes. You can allot more memory as your system allows.

The labels in the x-axis are too dense  i.e., the labels are overlapping each other.  How do I make it look better ?

You can set the label display step size under Format -> Axis Elements -> -> Label Step Interval in Chart Designer. You can also click on the Format value elements icon in the toolbar.

Are there any limitations on the length and type of characters in labels?

There is no practical limitation on the length of string in a label. However, the use of single quote in a string will cause plotting errors on data refresh.

The x/y grid in the chart is too dense.

You can set the grid step size in the axis label dialog box (under Edit-Axis Label...) in Chart designer or use the GRID_STEPSIZE property in API.

How can I change the Line Chart  so that it will not draw at the origin?

You can set the X_SHIFT property in the API to displace the whole line chart away from the origin.

Why does some of the text I add shift after the chart export?

EspressChart remembers the relative x, y ratio of the added text position relative to the drawing area. So when the size of the drawing area changes,  the text may shift.  To avoid this, try to design and export the chart using the same size.

How do I remove the log file for EspressEspressManager?

You can edit the file server.log or java-charting/services/chserver.ini (for NT services) to remove the -log option.

Why do the constructors for QbChart take Applet or Frame parameters? What info does it take from those params?

For Applet parameter, it is used to get the address of EspressEspressManager (i.e. get the remote server.cfg file) in the browsers environment and also export the chart using applet.createImage().

For Frame parameter, it is used in standalone application for export the chart using frame.createImage(). In this case the file server.cfg is assumed to locate in current directory.

At least one constructor is needed for export since createImage() needs a component object.

If you are not using EspressManager and not intend to export image you can pass a null pointer to the constructor as follows:

Frame frame = null;
QbChart(frame, ....);

or

Applet applet = null;
QbChart(applet, ....);

The color of the output reduced to 256 when I export in Chart Designer even though my graphics display supports true color.

This is a bug that happens in Netscape 3.x only.  In IE4.x and Netscape 4.x there is no such problem. Note that the color of the output depends on the no. of colors in your display card.

The scroll bar is very annoying! How can I get rid of it?

The scroll bars can be added or removed from the Format / canvas pulldown menu of EspressChart 2.1 or higher.

I don't like the current chart size. Can I make it bigger?

One may either use Format / canvas in Chart Designer or right drag the mouse on the chart to increase its size.

Why does my browser say that it cannot find the quadbase.chartViewer.Viewer.class even though my classpath is set to the root EspressChart directory when I create a HTML file to view a .cht file through the Chart Viewer?

The EspressChart classpath is probably set as a system variable and there may be a user classpath present without the EspressChart classpath.  Add the EspressChart classpath to the user classpath as well and run the HTML file again.

How to solve the problem that EspressChart.jnlp launches then disappears at once on Windows 10 with JRE 10?

Open “Java Control Panel” on Windows10. Enable 2 Options:
From Security tab: Enable Java Content in Browser (Required for Applets and Web Start Applications)
From Web Settings tab: Keep temporary files on my computer.
After the above setting, the jnlp file can be launched successfully. However, you’ve always get cached jnlp file. To get updated jnlp running, you need delete "Cached Applications and Applets" from Web Settings of Java Control Panel by clicking the button of “Delete Files” there.

When we tried using EspressChart on a simple telnet session (rather than XTerm) it gives us an error (some X11 windows error) ?

Please download the latest version of EspressChart for Solaris and try program /java-charting/help/examples/example9.html
We telnetted vt102 to Solaris using our PC and it works fine.

Please note that the most important things are :

  1. Use the addNotify() call if you do not intend to display the chart before constructing a Qbchart. Otherwise null pointer exception will occur.
  2. The Solaris system must have a display monitor and graphics card in it or have permission to X server.  JDK can't draw anything if your Unix machine doesn't have a display card or Xvfb (from XFree86 server) environment.  Note that the color of GIF/JPEG output is limited by the color resolution of the graphics adapter of it.
  3. You may need to type the command
    xhost +
    after login as a supervisor in the solaris machine locally (don't telnet from other machine and type xterm +). Otherwise you may encounter Xlib connection refuse error.
  4. You don't need to set display to your local machine (i.e. setenv DISPLAY machineName:0.0) even though your telnet program can emulate xterm. But you need to set the display variable of the server in order to pass the font and other graphic information to the X server. To test whether the X server is running, you may use the command ps -ef and see whether one of the process is /usr/openwin/bin/X If not you may start X windows manually by typing startx. After export with API, if the solaris hung, you may need to add the line System.exit(1); in the java code to stop the invisible frame that was created before export.

When running EspressChart remotely from a Unix server (e.g. Solaris) without a display card, it gives us a 'quadbase.chart.C-string class not found error' or 'X11 not found error' when connecting to oracle database?

You got this error when you tried to run EspressChart remotely without a display card on the server or without setting permission to X server. You can either run from the server using X window from another machine, or install Xvfb (from Xfree86) on your server before running EspressChart. You may also connect remotely with a X emulator connected to the server and X windows running on the local machine. Below is an example of one customer's setup: DISPLAY environment variable which has to be set does not need to be pointing to the server hosting espresschart. EspressChart can be on machine A, which does not have X. Machine B has X. Just point DISPLAY to machine B. It works fine for us since machine A is the web+apps server (for security reason X is not installed). Machine B is oracle, and it need X for some oracle database apps. Works fine (may be a bit slow since it has to hops from 1 to another). Below is one successful oracle connecting code, which runs with a classpath to classes12.zip

// Import all necessary classes
import quadbase.ChartAPI.*;
import quadbase.util.*;
import java.awt.*;
import java.sql.*;
import oracle.jdbc.driver.*;
import java.applet.*;

// Set up Frame

public class c2 extends Frame {

public QbChart chart;
// Start Frame
public c2() {

start();
}
// Create Empty Chart and set up initial data and wipe out empty chart data

public void start() {

QbChart.setChartServerUsed(false);
setLayout(new BorderLayout());
// primary axis value column 3
// secondary axis value column 2
// ColInfo(series, category, sumby, primary_value, secondary_value)
DBInfo dbinfo = new DBInfo('jdbc:oracle:thin:@serv1e:1521:owr98eh',
'oracle.jdbc.driver.OracleDriver', 'elkdss', // username 'welcome',
// password 'select to_char(PROD_INJ_DATE), OP/days_prod,GP/days_prod,
WP/days_prod from eh_dss.ZONE_VOLUMES p, eh_dss.ZONE_LOCATION l
where p.api = l.api and days_prod>0.0 and l.zonename like '326-26R%'');
// SQL query

ColInfo colInfo = new ColInfo(1, 0, -1, 2);
QbChart chart = new QbChart((Applet)null, QbChart.VIEW2D, QbChart.LINE,dbinfo,
true, colInfo,null);

// set background color to white
ICanvas hCanvas = chart.gethCanvas();
hCanvas.setBackgroundColor(Color.white);

Color[] colors={Color.black, Color.red, Color.orange, Color.blue, Color.green,
Color.pink, Color.cyan, Color.magenta, Color.gray, Color.pink, Color.lightGray,
Color.black, Color.yellow, Color.red, Color.green};

// Set XAxis
IAxis hXAxis = chart.gethXAxis();
hXAxis.setLabelOutsidePlotArea(true);
hXAxis.setVisible(true);
ILabel hXAxisLabel=hXAxis.gethLabel(); // Getting handle to x Axis labels
hXAxisLabel.setColor(Color.black); // Setting color to white
hXAxisLabel.setAngle(90); // Making them horizontal

// Set YAxis
IAxis hYAxis = chart.gethYAxis();
ILabel hYAxisLabel=hYAxis.gethLabel();
hYAxisLabel.setColor(Color.black);

// Set all axes
hXAxis.setArrowhead(false);
hXAxis.setThickness(5);

IDataPointSet dataPoints=chart.gethDataPoints();
dataPoints.setLabelStep(1, 2); // Show every 3rd label
dataPoints.setGridStep(1, 2); // Show every 3rd grid line and by entension ticker

dataPoints.setColors(colors);

//Hide legend ILegend legend = chart.gethLegend(); legend.setVisible(true);

//Best-fit primary axis IAxis iaxis = chart.gethYAxis(); iaxis.setOriginAutomatic(true);

add('Center', chart);

} //Start public static void main(String[] args) {

c2 t = new c2(); t.resize(500,550); t.setVisible(true);

}

} 

When we execute servlet in Solaris with JDK1,2 using API in EspressChart, it gives us a 'C-string not found error'?

The error is received because the X server cannot be connected to. This is a very deceptive exception. What you have to do is to start the X server under root and make sure it is accessible by EspressChart or the program running EspressChart API.

After X11R6 (Xvfb) started, EspressChart still gives 'quadbase/chart/C-string not found error'

After I started X, or Xvfb, I still have the problem and the culprit was the environment variable. I did not set my DISPLAY environment variable, since I always use telnet. You may want to include the hint on DISPLAY environment variable, since when you mention EspressChart could not find X, it is not very clear to non-admin people to trouble shoot. I got the hint from our admin support about DISPLAY property. DISPLAY can be set to simply ':1.0' or '127.0.0.1:1.0' or 'A.B.C.D:1.0' where 'A.B.C.D' is the machine's IP address. In Apache/Jserver, one line should be added to the jser.properties file when Apache and Jserver are started the same time. wrapper.env=DISPLAY=localhost:0.0.

For IBM AIX machine, login command window as Administrator export DISPLAY=IP_address:0.0 depending on which screen the X-Server is running on. Start Web Sphere in the same window.

On solaris and Iplanet Enterprise Web server, use either one of the following command lines after login as Administrator

setenv DISPLAY=IP_address:0.0 

export DISPLAY=IP_address:0.0 

You may want to add the above line to the start-up script of Iplanet Web server.

Are there alternatives to X-windows display and Xvfb?

One option is the PJA Toolkit. PJA Toolkit is a pure Java implementation of the GraphicsEnvironment methods in Java, and does not use native code. Therefore, can also be used in place of an X-window, or XVFB. Click here to download documentation & sample file for the PJA Toolkit.

Commands to run X server in background for Sun / Unix

Even though the solaris are running from a remote site, the production people refused to go headless as they wanted to be able to use the console in the event they could not reboot remotely. They also refused for us to send the DISPLAY to another server running the Xserver sighting security concerns. The workaround was the following:

> First, turned off the production CDE (this is the production's console login prompt):

>/usr/dt/bin/dtconfig -d

 

>Second, created a start-up script for when the system reboots to

>start up the local Xserver, create an xterm window at the local console and

>then lock the local console:

>nohup /usr/openwin/bin/Xsun :0 &

>nohup /usr/openwin/bin/xterm -C -rw -geometry 110x40 -ls -fn 10x20 -bg black -fg yellow -sb -sl 1000 &

>nohup /usr/openwin/bin/xlock &

 

> Third, started up Websphere with the following parameters added to

>it's start-up script

 

>DISPLAY=:0

>export DISPLAY

 

> Fourth, reboot the server.

This allows EspressChart to be able to use the Xserver and graphics card at all times while also allowing the system admin's the ability to still use their local console whenever they need to without having to affect the Xserver.

Does EspressChart support stored procedures?

Yes, you can specify a stored procedure in the query. For the multiple result sets/response reply, EspressChart will use the first non-empty result set to plot the chart. The mechanism is same for the code bridgeTest/TestDB.java in your EspressChart installation directory.

Does EspressChart support parameterized queries?

You need to format your query to be non parameterized before passing it to EspressChart. However you can set the query at any time in the API using the properties DATASOURCE. All attributes of chart will be preserved when the query is changed. Besides you can make use of Chart Viewer query input capability to dynamically generate html page for query of different parameters as follows:

<applet code = "quadbase.chartViewer.Viewer.class"  width=640 height=480>
<PARAM name="sourceDB" value="jdbc:odbc:DataSource, sun.jdbc.odbc.JdbcOdbcDriver,
userername, password, formatted query">
<PARAM name="dataMap" value="0 1 -1 3">
<PARAM name="chartType" value="3D Column">
<PARAM name="filename" value="mytemplate.tpl">
</applet>

Does EspressChart support object-oriented databases as well as SQL queries?

No, but Chart API allows you to fetch the data from database your own method and pass the data as an argument in the constructor of chart. (see QbChart).

Does EspressChart support real-time data fetching from database when Chart Viewer is loaded?

Yes, you can simply designed the chart by Chart Designer and save the chart in .tpl format, say mychart.tpl. The database URL, driver username, password are encrypted and saved together with the other chart attributes in mychart.tpl (except the database data). Then add the following code to your html page:

<applet code = "quadbase.chartViewer.Viewer.class" width=640 height=480>
<PARAM name="filename" value="mychart.tpl">
</applet>

Now every time the applet loads, it will contact the EspressManager to fetch the updated data from database and plot the chart.

Can I schedule Chart Viewer to refresh itself from a database after a specified time interval?

Yes, you can either set the scheduling interval through the Chart Designer and save it in .tpl format as above, or add the parameter 

<PARAM name="RefreshInterval" value="60">

in Chart Viewer. In the above example the chart will refresh every minute. Note that if the refresh time interval is set in both Chart Designer and Chart Viewer, the latter one is used. In particular if the refresh interval in chart Viewer parameter is set to a negative value then scheduling is disabled even if it has been set in Chart Designer.

Can I get data from my own datasource and push the data to chart viewer to update it continuously?

Yes, chart Viewer supports parameter server which allow users to push the data to the viewer. See the parameter server section in chart viewer.

Do I need to know programming or complicated EspressChart applet parameters in order to publish my own chart in the web?

No, all you need to do is go to the Chart Designer login page using any Java enable browser, follow the simple wizard steps to create and design your own chart. Then save the chart in either .cht or .tpl format and publish your chart on the web as follows:

<applet code = "quadbase.chartViewer.Viewer.class" width=640 height=480>
<PARAM name="filename" value="mychart.cht">
</applet>

How can I specify to use EspressManager in different machine instead of the one in Web server?

You can specify the connection details in either the API code to connect to a different EspressManager by using the setServerAddress and setServerPort methods in QbChart.

Can I save/load/export the chart in client machine instead of server machine?

You can eliminate the need for connecting to EspressManager by calling the static method setEspressManagedUsed(false), before creating the QbChart constructor. Now all save/load/export will have on the machine running the code, rather than the server machine.

Does EspressChart support JavaBeans?

EspressChart 1.4 and higher support JavaBeans as component in an IDE environment.

Can I export the chart in other formats?

Yes, you can export the chart in GIF, JPG, PNG, BMP, WMF, WRL, FLASH, PDF, TPL and CHT format using either Chart Designer or the Chart API.

Does EspressChart support image maps?

Yes, you can define hyperlinks with different url and target in Chart Designer (see manual) or API (see example14.html). When chart is export in the GIF/JPEG and BMP formats, two files with extension .map (for client side image mapping) and _s.map (for server side image mapping) will be exported in the same directory as the image when the hyperlink is defined. You can then import this .map file in your html page easily. See document source in maparea3d.html.

Is it necessary to install the classpath of EspressChart in the environment variable CLASSPATH in web server machine?

No, the installation program add the classpath for programmer to use the API. You can safely remove the classpath from the environment variable CLASSPATH.

Can we pass data directly to the Chart Viewer in the html page?

Yes, here is an example:

<applet code = "quadbase.chartViewer.Viewer.class" width=640 height=480>
<PARAM name="sourceData" value="int string int | value name, vol | 10, 'John', 20 
| 3, 'Mary', 30 | 8, 'Kevin' 3 | 9, 'James', 22">
<PARAM name="dataMap" value="-1  1 -1 2">
<PARAM name="chartType" value="3D Bar"<
<PARAM name="filename" value="mytemplate.tpl"> </applet>

The last parameter filename is optional. It specifies a template to apply to the chart. If it is omitted, the default attributes are used.

How can I change the default port number of EspressChart?

It is not a good idea to change the default port no since EspressChart will use 22071 as the default one when it fails to load server.cfg. However you can change it by editing the section [portno] in java-charting/userdb/config.txt. After that, restart the EspressManager (so that a new config file server.cfg is created), the Web server (since it may cache the old version of config file), and the browser (since it will cache the config file locally).

Can EspressChart support different date/time formats?

Yes, EspressChart supports different formatting option of date/time, timestamp, boolean and numeric value. See the user's guide for details.

Where can I found documentation on NumericFormat, DateTimeFormat, LogicalFormat ?

They are located in the apidocs under EspressChart/help/apidocs/index.html .

Why is the Trend Line missing in some charts?

Currently, only 2-d charts of types Column, Stack Column, Area, Stack Area, Scatter, Line, HLCO and Hi-Low support Trend Line.

Parameterized query not working with error message 'Service does not support parameterized query'

EspressManager has to start with EspressManager.bat for the Parameterized query to work. Please see the known bug list.

When using the API I got message 'Failed to read server.cfg, use default host and port no 22071'

The chart API is trying to contact EspressManager but failed to locate the server.cfg file. You can either safely ignore this message (if the default is OK) or copy the server.cfg file from the espresschart installation directory (after EspressManager is started) to your program directory (or codebase directory of your program).

Can the Chart API do without EspressManager?

For operations that do not require contacting EspressManager, you may use the QbChart class static method: setChartServerUsed(false) which will replace the EspressManager with the current directory of espresschart.

Where can I find more API examples?

The API examples are contained in EspressChart/help/examples/index.html.

The jar files are too big. Can they be smaller?

One may select EspressAPI_2D.jar, or EspressAPI_3D.jar to replace EspressAPI.jar in your application if only 2D or 3D charts are needed.

How can I put the chart at the center of the canvas?

You may set the width and the height in API to (1-W)/2 and (1-H)/2 where W and H are the width and height of the chart. You can obtain W and H by using the getRelativeWidth and getRelativeHeight methods from the chart's canvas.

Where is the API information on data transpose?

The API is called isSpreadSheetFormat (boolean) and the documentation is located in helpapidocsquadbaseChartAPIQbChart.html

How do I specify the column mappings for the chart?

Use ColInfo to set the column mappings for the chart.

For example, if you want to create a StackColumn-Stack Area combo chart and you wanted to use

  • Column 3 as your category
  • Column 1 as your series
  • Column 2 as your sum-by
  • Column 5 as your value; and
  • Column 4 as your subvalue

then use the following code:

ColInfo colInfo = new ColInfo(1, 3, 2, 5, 4) 
// ColInfo (series, category, sumby, value, subvalue)

OR

ColInfo colInfo = new ColInfo();
colInfo.category = 3;
colInfo.series = 1;
colInfo.sumby = 2;
colInfo.value=5;
colInfo.subvalue=4;

How do I set the decimal point and remove the thousand seperator?

Create a NumericFormat object and set its properties.  And then get a handle to IDataPointSet and use setLabelFormat to set the properties for the column.

For example, if the format for Column 2 has to be changed to remove the thousand seperator and to have no decimal, then use the following code:

NumericFormat format = new NumericFormat();
format.decimal = 0;
format.thousandSep = 'N';

IDataPointSet dataPoints = chart.gethDataPoints(); 
// where chart is the QbChart object
dataPoints.setLabelFormat (2, format);

How do I set the chart so that it cannot be dragged or resized?

Get a handle to IMouseEventSet and use the methods setDragEnabled and setResizeEnabled.

IMouseEventSet mouseEvents = chart.gethMouseEvents(); 
// where chart is the QbChart object
mouseEvents.setDragEnabled(false);
mouseEvents.setResizeEnabled(false);

How do I change the scale of an axis?

Get a handle to IAxis and use setScaleAutomatic to disabel automatic scaling and then the methods setMinScale, setMaxScale and setScaleStep to provide the new scale.

For example, if the y-axis scale has to be changed so that it starts at -10 and ends at 100 in increments of 10, then use the following code:

IAxis yAxis = chart.gethAxis();    
// where chart is the QbChart object
yAxis.setScaleAutomatic(false);
yAxis.setMinScale(new Integer(-10));
yAxis.setMaxScale(new Integer(100));
yAxis.setScaleStep(new Integer(10));

How do I swap the primary and secondary axis and how do I specify the chart type for the secondary axis?

Get a handle to ISecondaryAxis and use setSwapAxis to swap the primary and secondary axis.  To specify the chart type for the secondary axis, use the method setCombinationType

ISecondaryChart secondaryChart = chart.gethSecondaryChart();
secondaryChart.setCombinationType(QbChart.COMBO_COL); 
// Sets the secondary chart to be a Column Chart
secondaryChart.setSwapAxis(true); 
// Swaps the primary and secondary axis

How do I change the font settings for the labels, titles, etc. ?

Get a handle to the interface (for example, gethMainTitle() for the main title, IAxis.gethLabel() for the data top labels, IAxis.gethTitle() for the axis title etc.).  Then if the methods of IText are inherited, you can call the methods setAngle, setColor and setFont OR you can get a handle to the IText interface and call the methods there.

For example, if the data top labels for the x axis are shown in 90 degrees (vertically, bottom to top), color Red and font Times New Roman, size 12 and Bold, then use the following code:

IAxis xAxis = chart.gethXAxis();
ILabel xLabel = xAxis.gethLabel();
xLabel.setAngle(90);
xLabel.setColor(Color.red);
xLabel.setFont(new Font('Times New Roman', Font.BOLD, 12));

How do I explicitly set the color for the series or categories (if no series are specified)?

Get a handle to IDataPointSet and create an color array object and then use setColors to assign the colors.  Please note that if the number of categories/series do not match the number of elements in the color array object, the colors will not be assigned.

For example, if there were four elements in the series, then use the following code:

IDataPointSet dataPoints = chart.gethDataPoints();
Color dataColor[] = {Color.white, Color.yellow, Color.red, Color.blue};
dataPoints.setColors(dataColor);

How do I change the Origin of the chart i.e., where the x-axis and y-axis intersect?

Get a handle to the axis and use setOffset to change where the axis intersect each other.

For example, if you want the axis to intersect at (4, 25), then use the following code:

IAxis xAxis = chart.gethXAxis();
xAxis.setOffset(new Integer (4));

IAxis yAxis = chart.gethYAxis();
yAxis.setOffset(new Integer (25));

How do I set it up so that the navigation panel does not show up when a 3d chart is shown and disable the toggling?

Get a handle to I3DControlPanel and use the method setVisible to not show the nagivation panel and setToggleEnabled to disable the toggling.

I3DControlPanel navPanel = chart.geth3DControlPanel();
navPanel.setVisible(false);
navPanel.setToggleEnabled(false);

How do I set it up so that the chart is always displayed without any need for scroll bars?

Use the following code to set up the chart so that if the applet/frame size is increased or decreased, the chart is always shown without any need for a scrollbar.

QbChart.setScrollBarOption(ScrollPane.SCROLLBARS_NEVER);

Dimension appletSize = this.getSize();
Dimension chartSize = new Dimension();

// Setting the size of the chart to that of the applet
chart.setSize(appletSize);

// Preventing resizing or dragging so chart remains centered
IMouseEventSet mouseEvents=chart.gethMouseEvents();
mouseEvents.setDragEnabled(false);
mouseEvents.setResizeEnabled(false);

How do I write an application to export a chart in GIF/JPEG form without using EspressManager?

You can obtain it from the manual which can be viewed here.

How do I use a servlet to export a chart in GIF/JPEG form to browsers?

You can obtain it from the manual which can be viewed here.

How do I read null data in EspressAPI to replace 0 value for the purpose of eliminating colored line in stackcolumn chart?

Reading from a data file, the zero data is '0' or 0 and the null data '' with Chart Designer. However, the null data is null instead of '' with Chart API. This is because null is a keyword in Java but not in txt file.

How do I make Chart Legend square with ChartAPI?

Use the following code to set up the Chart Legend square with ChartAPI.

QbChart chart = new QbChart(applet, "chart/testnf.pac"); //Or any pac file
chart.gethLegend().setLayout(QbChart.FIXED_COLUMN);
chart.gethLegend().setNumberOfFixedColumn(3);
chart.getChart().legend.useOneLegendSet=true;
chart.export(QbChart.PNG, "chart/testnf.png");

 

Sitemap | Privacy Policy | Contact us | Products | Hosted Services | Gallery | Sales | Support/Services | Company

 

© 2023 Quadbase Systems Inc. All Rights Reserved.