|
Custom Data |
Top Previous Next |
|
This data source type is supported by all charts. When it's enabled chart's dataset is build in two stages. Reading Source Data First, a widget binding must be used to set value of Source Data chart tabular property. This binding's expression must return a Data Table, e.g. by reading value of context variable or executing context function.
Example of Source Data binding:
Building The Dataset Once Source Data property is filled or refilled by the binding, chart starts rebuilding its internal dataset and refreshing. This is done by processing Source Data table record-by-record and using Chart Bindings for fetching different dataset values (such as X, Y, or Category) from it. Here is a step-by-step description of this process:
3. The process is repeated for the remaining Source Data Bindings records, if there are more than one. Examples Since the above concepts may seem complicated at first glance, let's illustrate them with several examples. Pie Chart This simple example shows how to build a Pie Chart depicting stats of network interfaces types in a network management system. First, we set up the binding that executes a query and fills Source Data table with its results. Here is a source data table (field names are shown in bold):
The Source Data Bindings table of our chart will look as follows:
This means, that we'll use values from Interface Type column to fill dataset keys ("pie piece names") and values from Interface Count column to fill dataset values ("pie piece sizes"). Here is how resulting chart will look like:
Bar CHART This example shows how values for different data series may be take from different columns of Source Data table. It's a Bar Chart indicating current incoming and outgoing traffic for top ten most active network interfaces in a network management system. Below is the Source Data table for this chart. It was also set by binding upon widget startup.
We need to take incoming traffic values from the third column and outgoing traffic values. Therefore, we'll need two Source Data Bindings records:
This table indicates that there will be two series in the chart. During the processing of first Source Data Bindings record all added dataset entries will belong to a series with fixed name Incoming Traffic, bps (it's quoted as a string literal, since all Source Data Bindings table cells contain expressions). During processing of second record, all dataset entries will belong to Outgoing Traffic, bps series. The resulting chart:
Bubble Chart Note that every type of chart contains a default Source Data table and default Source Data Bindings that greatly help understanding chart functionality. This example uses the default data and bindings of a Bubble Chart to illustrate its dataset creation. Chart Source Data:
Chart Source Data Bindings:
These bindings are very straightforward: value of every dataset item is takes from the Source Data field with the same name. Note that Z is the size of bubbles, while X and Y are their coordinates. Here is the resulting chart:
|