2D DataPoints API
Data Mapping
Enable Data Refresh
Data Points
Show Top Labels
Customize Top Labels
Set Color
Set Sort Order
Set Column/Bar Width
Hide Zero-Value Data Points
Time-Based Zooming
Drill Down
Dynamic Drill Down
Hyperlinks
Histogram

Data Mapping
Before a chart is actually created, we need to specify the data mapping information to EspressChart. To do so, we can create an instance of the colInfo class and include this in the QbChart constructor that we will call.

Explanation:
Series: Let’s assume we have four sets of two-dimensional data of the same subject (category). If we plot these four sets of data on the same graph, we would have a "series" of four data sets.  Pie charts do not support series.

Category & Value: If category is the base, the corresponding data will be value. In a vertical column chart, the columns are separated by the category data, X-Axis, while the height represents the value data, Y-Axis. Value data are usually numerical while category data are not necessarily numerical. Category data can be numbers, time, date, or alphabets, i.e. names, groups... etc.

Sub value: also referred to as "2nd value" in EspressChart Designer, sub value index let EspressChart know where to obtain the value of a combination chart.

// Create an colInfo object that specifies infomation on data mapping
// ColInfo(int series, int category, int sumBy, int value, int subvalue)
int series = -1; // use –1 if no series
int category = 0; // category data in column 1, thus, index 0
int sumBy = -1; // use –1 if not used
int value = 2; // value data in column 3, thus, index 2
int subvalue = -1; // not plotting a combination chart, use –1
ColInfo sampleColInfo = new ColInfo(series, category, sumBy, value, subvalue);

// Alternatively, a ColInfo object can be constructed as below
ColInfo sampleColInfo = new ColInfo();
sampleColInfo.category=0;
sampleColInfo.value=2;
// QbChart(java.applet.Applet applet, int dimension, int chartType,
// IDatabaseInfo dbinfo, IColumnMap cmap, java.lang.String template)
QbChart chart = new QbChart( null, QbChart.VIEW2D, QbChart.BAR,
yourData, sampleColInfo, null);

For example, consider the following data
 
 
Name Year Units Ordered Unit Sold
James 1999 34 30
James 2000 43 32
Peter 1999 23 21
Peter 2000 54 39
Sample Data

The following ColInfo can be mapped

ColInfo colInfo = new ColInfo();
colInfo.category=0;    // The Name column
colInfo.series=1;        // The Year column
colInfo.value=2;        // The Units Ordered column
colInfo.subvalue=3;        // The Units Sold column
Enable Refresh
// enable speed key (Ctrl + R) to data refresh,
// right click pop-up menu will still work
chart.setRefreshEnabled(true);
Data Points
To set properties on the Data Points such as top label, set color, sort data points...etc, first create an IDataPointSet object that has a handle on the chart's DataPoints. Then, the properties can be edited through methods in the IDataPointSet. Time-Based Zooming
To set zooming properties on the data points. First, create an IZoomInfo object that has a handle on the chart's ZoomInfo. Then, the properties can be edited through methods in the IZoomInfo. Please note that zooming can only be done on data of time. The "zooming" feature is in all the chart types, except bubble, box, dial, hi-low, radar, surface, and scatter charts. No more than one of the three options can be performed on data: zooming, drilldown, or histogram. Drill Down
To create Drill-Down charts, first create an object that has a handle on the chart’s DrillDown properties. Then, DrillDown properties can be specified through the IDrillDown class methods. Please note that no more than one of the three options can be performed on data: zooming, drilldown, or histogram. Drilldown feature is for all chart types, except box, bubble, dial, high-low, radar, surface, and scatter charts. Dynamic Drill Down Hyperlinks
To create charts with Hyperlinks, first create an object that has a handle on the chart’s Hyperlinks properties. Then, hyperlink properties can be specified through the IHyperLinkSet class methods. Histogram
To create Histogram charts, first create an object that has a handle on the chart’s HistogramInfo properties. Then, Historgram properties can be specified through the IHistogramInfo class methods. Please note that no more than one of the three options can be performed on data: zooming, drilldown, or histogram. Please refer to QbChart, ColInfo, IColumnMap, IDataPointSet, IZoomInfo, IDrillDown, IHyperLinkSet, HyperLink, & IHistogramInfo in EspressChart APIDocs for additional information.