InetSoft Product How-To: Binding Data to a Chart Element

Data charting software is frequently used in business reports to visually present information. Style Intelligence offers most common chart types, including bar chart, pie chart, line chart, point chart, area chart, and many more. Like the table elements, the data for a chart can be programmatically supplied through the reporting API, or visually bound to the chart using Report Designer.

Unlike tables, which can flow across pages and contain a large amount of data, a chart is normally drawn in a relatively small area on the page. Therefore, the amount of data a chart contains is relatively small. If the raw data set is large, you can group and summarize the data during the binding process, and then display the summary information on the chart.

To bind a chart to a data model or a query, right-click the chart and select ‘Bind Data’ from the context menu (or click the ‘Query Binding’ button in the toolbar).

executive dashboard

Walkthrough: Data Binding for a Chart

In this example, you will create a chart that displays Sales vs. State.

  1. Open Report Designer and click the ‘New’ button. In the ‘Create Report’ dialog box, select ‘Blank Tabular Report’ and click ‘OK’
  2. Click the ‘Chart’ button to add a blank chart to the report.
  3. Add a text element above the chart, set the text to “Total Sales by State”. Center the text, and make the font Bold 14-point. This will be the chart title.
  4. Click on the chart to select it. Then right-click on the chart and select ‘Bind Data’ from the context menu. This opens the ‘Data Binding’ dialog box.
  5. Under the Data tab, expand the ‘Orders’ data source, and select the ‘sales by state’ query.
  6. Select the Chart tab.
  7. Drag the ‘State’ field from the ‘Available Columns’ panel to the ‘X’ region of the ‘Data’ panel.
  8. Drag the ‘Sales’ field from the ‘Available Columns’ panel to the ‘Y’ region of the ‘Data’ panel.
  9. Click the ‘Edit Measure’ button next to the ‘Sales’ field, and make sure that ‘Sum’ is selected from the aggregate menu.
  10. Click the ‘Edit Dimension’ button next to the ‘State’ field.
  11. From the ‘Ranking’ menu, select ‘Top’, enter “2” for the number of groups, and select ‘sum(Sales)’ for the aggregate.
    • This specifies that the chart should display only the top two state records according to their sales.
  12. Click ‘Finish’ to save the settings.
  13. Click the ‘Preview’ button to view the report.

Setting Date Grouping Properties When you use a date field as a dimension, you can specify the level of date grouping (month, year, etc.). To do this, click the ‘Edit Dimension’ button for the desired date field, and choose the desired grouping from the ‘Level’ menu.

If the data represents a series of measurements at uniformly-spaced time intervals, select ‘As Time Series’. This forces the chart to display all measurement periods, even those for which no corresponding data is available. Otherwise, these “empty” periods are suppressed.

It is important to set the format of the labels to the match the grouping level. For example, dates grouped by year should have a format such as “yyyy” to display just the year component of the date.

demo icon
View a 2-minute demonstration of InetSoft's easy, agile, and robust BI software.

Previous: Constructing Freehand Tables