CordaChartBuilder class

The CordaChartBuilder class provided by the Endeca Charting API supports the rendering of Analytics analytics results in a wide variety of Corda PopChart visualizations with a minimal amount of custom application code.

HTML tables are useful for some Analytics applications, generally where the number of data points is not too large, and trends and comparisons can easily be observed in the raw numeric data. However, most Analytics applications require the use of graphical data visualizations such as charts and graphs to effectively present results of complex numeric analyses.

The CordaChartBuilder class supports the rendering of Analytics results in a wide variety of Corda PopChart visualizations with a minimal amount of custom application code. The CordaChartBuilder class builds upon the Grid class presented in the topic “Grid class”.

Before using the CordaChartBuilder class, you first need to create a Grid object containing the Analytics results of interest. Basic usage of the CordaChartBuilder is extremely simple. The application initializes an instance with a String chart name and a Grid containing the data, then calls the getPCXML method to get an XML String suitable for input to Corda for rendering as a chart.

Note: In order to include a Corda chart, the CordaEmbedder library must be included in the application. For Java, it is the CordaEmbedder.jar. See the Corda documentation for details.

The "PCXML" XML object created by the CordaChartBuilder formats Endeca data for presentation in a Corda chart. Generally, additional presentation configuration (such as the size of the chart) must be specified using the Corda API.

Example

The following simple example illustrates a typical rendering sequence:
<%@ page import="com.corda.CordaEmbedder" %><%
Grid g = new Grid(iterator, "TransCount","Region", "Quarter");
CordaChartBuilder ccb = new CordaChartBuilder("graph", g);
CordaEmbedder image = new CordaEmbedder();
image.externalServerAddress = "http://<corda-host>:2001";
image.internalCommPortAddress = "http://<corda-host>:2002";
image.appearanceFile = "apfiles/small_bar.pcxml";
image.userAgent = request.getHeader("USER-AGENT");
image.width = 200;
image.height = 100;
image.returnDescriptiveLink = false;
image.language = "EN";
image.outputType = "FLASH";
image.addPCXML(ccb.getPCXML());
%><%= image.getEmbeddingHTML() %>