Overview

The chart configuration page appears as follows.

The fields to configure are the following:

  • Name: a chart name of your choice.
  • Type: the chart type: choose among a range of one-dimensional and two-dimensional charts.
  • Orientation: choose horizontal or vertical. 
  • Legend: the legend to be included inside the chart.
  • Database: the database on which the query will run.
  • SQL Query: the SQL underlying the chart. See the discussion below.
  • URL expressions: to make the chart areas clickable, enter a URL expression. See below

SQL queries

For 1d charts, the queries should be structured as follows:

SELECT key, value, label
FROM <tables>
WHERE <conditions>
<GROUP BY clause>

Where:

  • key is the key of the dimension
  • value is the value associated to the key
  • label is an optional label for the key. If not provided, the label will be the same as the key

For 2d charts, the queries should be structured as follows:

SELECT x_key, y_key, value, x_label, y_label
FROM <tables>
WHERE <conditions>
<GROUP BY clause>
Where:
  • x_key is the key of the first dimension
  • y_key is the key of the second dimension
  • value is the value associated to the combination of x_key and y_key
  • x_label is an optional label for the x_key. If not provided, the label will be the same as the key.
  • y_label is an optional label for the y_key. If not provided, the label will be the same as the key.

 

URL expressions

To make chart areas clickable, you can enter a URL expression. This allows you to point the chart to drill down pages.

A URL expression is basically a URL with variable parts. Variable parts are defined by OGNL expressions such as %{myexpression}.

For 1d charts, valid OGNL expressions include:

  • %{key}: the key of the current area
  • %{index}: the index or position of the current area
  • %{dataset}: the org.jfree.data.general.PieDataset object

For 2d charts, valid OGNL expressions include:

  • %{series}: the x_key of the current area
  • %{category}: the y_key of the current area
  • %{dataset}: the org.jfree.data.category.CategoryDataset object

URL expressions that start with a "/" are relative to the application. URL expressions that start with "http://..." are absolute and can point anywhere even outside the application.