Skip to main content
Pentaho Documentation

Add Data to a Chart

Before you can start creating a chart you must choose a data source that contains the data you want to use. You must then define the data that will be displayed in the chart. If you are unsure what chart type is best for displaying your data, see Choosing the Correct Chart Type for more information.

Use these steps to add data to your chart.

  1. In the Dashboard, choose a dashboard panel and click File:/select_content_type.png (Insert) and choose Chart. The Select a Data Source dialog box appears.
  2. Select the data source from the list of available choices. The data source contains the content you want to display in your chart. The Query Editor appears.
  3. The Query Editor allows you to retrieve dynamic data from a database for display in a chart. Defining your query is the first step in ensuring that the correct data is selected. In the Query Editor, click (+) next to a category name to display its associated table columns.
  4. Click the small green arrow to place the column name under Selected Columns. In the example below, the Customernumber column has been selected and moved under Selected Columns. Notice that the column names appear under Selected Columns. Continue adding columns as needed. File:/06_mql_select_columns.png
  5. Now add the Conditions; these are your constraints that filter what you are choosing. You can add multiple conditions. In the example below, the search is limited to customer numbers. File:/07_mql_where_clause.png Under Combine, you can choose your constraint (and, or, and not, or not) from the drop-down list. Under Comparisons you can click the drop-down list to display options for comparisons, =, <, >, and so on; (for example, where the customer number is equal to 144 or 145). You can also choose an aggregation type from the drop-down list for table columns that contain numeric data. The table below contains a definition for each aggregate type:
    Aggregate Type Description
    SUM Sums a column's values
    COUNT Counts a column's values
    AVG Averages a column's values
    MIN Selects the minimum column value
    MAX Selects the maximum column value
    Click Preview at any time to view the data associated with your query.
  6. Add the columns that you want to Order By. The ordering of the selected data is accomplished by one or more columns in a table. For example, you can sort the data by customer name and address.
  7. Click OK in the Query Editor when you are done. The Chart Designer appears.
  8. Under Data, click the drop-down arrow to display and choose the table columns. File:/17_drag_and_drop.png
    Data Definition Description
    Series Column Series show up as the individual columns on a bar chart and as individual lines in a line chart. Area charts display each series as a point.
    Category Column Categories are displayed as bars or groups of bars on the x-axis (horizontal axis). In line charts, categories are usually associated with time periods. In area charts, the x-axis displays the category labels.

    If you don't want to display categories, choose None.

    Values Column The value is always numeric. The value determines the height of columns in a bar chart and the height of lines in a line chart. In area charts, the y-axis values determine the heights of the points.

    File:/series_category_values.png

    A preview of the chart appears in a box in the upper-right corner of the Chart Designer as you choose your options.
  9. Under Chart Type, click a chart type to choose it. By default, pie and dial charts display in "animated" Flash mode. You can turn animation off by disabling the Animated check box in the Chart Designer. Animated charts bring focus to important aspects of your data. For example, animation allows you to bring out a data point if it reaches a critical value, such as high or low sales numbers. If you selected a pie or dial chart, see Working with Pie Charts or Working with Dial Charts, respectively.
  10. Under Theme, choose a theme from the list. The theme is applied to your chart.
  11. Enter the labels for the Chart Title, X Axis Title (horizontal axis), and Y Axis Title (vertical axis). Entries are displayed in the chart preview.

    File:/09_chart_preview.png

  12. Click Apply to see the chart preview.
  13. Click OK display your chart in the dashboard panel.