ChartGenerator
Creates a raster Line, Bar, Scatter, Histogram or Pie chart based on the values of selected attributes, featuring an interactive interface that allows the user to preview selected features with sample data while designing the layout of their chart. Multiple data series may be specified for plotting on the same chart and many options for chart presentation and labeling are available. This transformer replaces the deprecated WebCharter transformer.
This transformer allows for the creation of 5 different chart types: Line, Scatter, Pie, Bar and Histogram. Different chart specific options are available for each type.
Configuration
Input Ports
Input data values for the chart can be specified from either attributes or, alternatively, list attributes for compatibility with the WebCharter.
When data is specified from attributes, each specified attribute defines a data series and each feature provides a value in the data series. In this mode, this transformer becomes a blocking transformer, releasing features only after all input features, or all values in the data series, have been received. Thus, the sum of all the input features produce either a single raster chart, or a one per group if Group By is enabled.
When data is specified via list attributes, each feature represents a chart and each list attribute on the feature represents a data series in the chart. In this mode, this transformer becomes non-blocking as a single feature contains all the data needed to generate the chart and one output feature is produced for each input feature. Group By settings are ignored in this mode.
Output Ports
The output of the transformer is raster charts in the form of raster geometries on the features. Each raster feature can be routed to any of FME’s supported image formats such as PNG, JPEG or TIF using the respective writers, or incorporated into a PDF or an Excel report using the PDF writer or the Excel writer along with optional formatting or raster manipulation transformers.
Parameters
Group By |
If the Group By parameter is set to a set of attributes, one raster per group will be produced. Note that Group By is not applicable if using list attribute input since each input feature already represents a single chart and corresponds to an output feature, so grouping input features is not required. |
Complete Groups |
When All Features Received: This is the default behavior. Processing will only occur in this transformer once all input is present. When Group Changes (Advanced): This transformer will process input groups in order. Changes of the value of the Group By parameter on the input stream will trigger processing on the currently accumulating group. This may improve overall speed (particularly with multiple, equally-sized groups), but could cause undesired behavior if input groups are not truly ordered. Considerations for Using Group By
There are two typical reasons for using When Group Changes (Advanced) . The first is incoming data that is intended to be processed in groups (and is already so ordered). In this case, the structure dictates Group By usage - not performance considerations. The second possible reason is potential performance gains. Performance gains are most likely when the data is already sorted (or read using a SQL ORDER BY statement) since less work is required of FME. If the data needs ordering, it can be sorted in the workspace (though the added processing overhead may negate any gains). Sorting becomes more difficult according to the number of data streams. Multiple streams of data could be almost impossible to sort into the correct order, since all features matching a Group By value need to arrive before any features (of any feature type or dataset) belonging to the next group. In this case, using Group By with When All Features Received may be the equivalent and simpler approach. Note: Multiple feature types and features from multiple datasets will not generally naturally occur in the correct order. As with many scenarios, testing different approaches in your workspace with your data is the only definitive way to identify performance gains. |
Type |
Select the type of chart to be created. Depending on the value chosen here, different chart-type-specific options will be available under the Data Series section. Values for chart type include Pie, Bar, Histogram, Scatter and Line. |
||||||||||||||||||||
Title |
This parameter allows the user to set a title which will appear at the top of the chart. |
||||||||||||||||||||
Plot Multiple Data Series |
This option is only enabled when Chart Type is set to Line, Scatter, or Bar. When this option is set to Yes, the user may specify 2 or more data series and may set the data series parameters for each data series individually. |
||||||||||||||||||||
Legend |
This option allows for a legend to be generated and displayed with the chart. If a single data series is plotted, the legend labels will depend on the value of the Chart Type parameter. The Data Attribute name will be used for Bar and Histogram chart types and the Y Attribute will be used for the Line and Scatter chart types. For the Pie chart type, the unique attribute values of Data Attribute will be used. If multiple data series are plotted, the legend labels will correspond to the data series names. Note: It is possible to choose Yes for Plot Multiple Data Series, and remove all but one of the data series. This would create a legend label that could be renamed.
|
||||||||||||||||||||
Axes |
For all Chart Types except Pie charts, additional Axes settings can be set, such as X Axis Label and Y Axis Label.
Further there are additional settings which can be set for each axis individually. These include:
|
||||||||||||||||||||
Style |
|
||||||||||||||||||||
Output |
|
The parameters available here depend on the value of the Chart Type parameter. Parameters for each Chart Type are detailed below.
Data Attribute |
Specifies an attribute whose values will be displayed in the bar graph. The values can be provided in two ways, either through attributes that contain counts, or through repeated attribute values to be enumerated by the transformer. In the first case, Data Attribute is an attribute containing numeric count values which will determine each bar size, while Data Label Attribute is set to an attribute whose values contain the respective labels for the counts contained in the data attribute. For example, Data Attribute has values 3, 2, 1 and Data Label Attribute has values ‘Rain’, ‘Snow’, ‘Hail’. In the second case, Data Attribute can be set to an attribute containing numeric or non-numeric data, where the count is determined from the count of the unique values, and the values themselves become the labels. Data Label Attribute is left empty. For example, Data Attribute has values ‘Snow’, ’Snow’, ’Rain’, ’Snow’, ‘Hail’, ‘Snow’, ‘Rain’. |
Data Label Attribute |
Specifies the labels to be used for each bar when Data Attribute is used to specify the bar size. If this parameter is empty, each unique value of Data Attribute will be used as a label. |
Color |
Sets the color of the bars, specified by an RGB String (“0,0,1”, for example). If colors are provided on individual features via the setting of the fme_color attribute, these values will override the color set here. |
Bar Orientation |
Sets the chart orientation to be either Horizontal or Vertical. |
Stack Bars |
When set to Yes, data series bars are placed on top of each other as opposed to side by side. This parameter is only available when Plot Multiple Data Series is Yes. |
Bar Width |
Sets the width of each bar. The width must be between 0.1 and 1.0. |
Data Attribute |
Specifies an attribute whose numeric values will be binned to create the histogram. |
Number of Bins |
Specifies the number of bins that will be created for the histogram. |
Color |
Specifies the color of the histograms bars. The default color is blue. If colors are provided on individual features via the setting of the fme_color attribute, these values will override the color set here. |
Trend Line |
Specifies whether a line fitting the histogram to a Gaussian will be shown. This option is disabled by default. |
X Attribute |
Specifies the attribute whose values will set the X coordinate of the vertices of the line. |
Y Attribute |
Specifies the attribute whose values will set the Y coordinate of the vertices of the line. |
Error Attribute |
Sets the value for the length of error bars corresponding to each vertex by choosing an attribute or list attribute. |
Color |
Specifies the color of each line. If colors are provided on individual features via the setting of the fme_color attribute, these values will override the color set here. |
Line Style |
Sets the pattern on the line. Possible styles are Solid, Dashed, Dotted, and Dash-Dot. |
Line Width |
Sets the thickness of the line. |
Fill Area |
Selects whether the area below the line will be filled in with a semitransparent pattern the same color as the line. This option is turned off by default. |
Discrete X Values |
Selects whether the X values are discrete or continuous. |
Discrete Y Values |
Selects whether the Y values are discrete or continuous. |
Point Marker |
Selects the shape of the icon at each point. Options include basic symbols such as circle, square, diamond and triangle. |
Data Attribute |
Specifies an attribute whose values will be displayed in the pie chart. The values can be provided in two ways, either through attributes that contain counts, or through repeated attribute values to be enumerated by the transformer. In the first case, Data Attribute is an attribute containing numeric count values which will determine each pie wedge size, while Label Attribute is set to an attribute whose values contain the respective labels for the counts contained in the data attribute. For example, Data Attribute has values 3, 2, 1 and Label Attribute has values ‘Rain’, ‘Snow’, ‘Hail’. In the second case, Data Attribute can be set to an attribute containing numeric or non-numeric data, where the count is determined from the count of the unique values, and the values themselves become the labels. Label Attribute is left empty. For example, Data Attribute has values ‘Snow’, ’Snow’, ’Rain’, ’Snow’, ‘Hail’, ‘Snow’, ‘Rain’. |
Label Attribute |
Specifies the labels to be used for each pie wedge when Data Attribute is used to specify the wedge size. If this parameter is empty, each unique value of Data Attribute will be used as a label. |
Color Scheme |
Color Scheme controls the color of the wedges based on a color ramp. If the Take from fme_color option is selected, color values for individual wedges can be supplied via the fme_color attribute. fme_color can be set by using the FeatureColorSetter transformer or by setting the value of this attribute to a valid RGB string (“1,0.5,0.3”, for example). |
Show Percentages |
When this option is selected the percentage corresponding to the size of each wedge will be displayed. |
Effects |
When this is set to Explode Slice, the first wedge will be separated from the rest and the pie will be shaded creating a pseudo 3D effect. |
X Attribute |
Specifies the attribute whose values will set the X coordinate of each point in the scatter plot. |
Y Attribute |
Specifies the attribute whose values will set the Y coordinate of each point in the scatter plot. |
Error Attribute |
Sets the value for the length of error bars corresponding to each vertex by choosing an attribute or list attribute. |
Color |
Sets the color of the points per data series. If colors are provided on individual features via the setting of the fme_color attribute, these values will override the color set here. |
Point Marker |
Selects the shape of the icon at each point. Options include basic symbols such as circle, square, diamond and triangle. |
Point Size |
Sets the size of the icon at each point. |
Show Least Squares Fit Line |
Specifies whether to plot a line with the equation calculated based on a basic least squares fit of the points. This option is off by default. |
Discrete X Values |
Selects whether the X values are discrete or continuous. |
Discrete Y Values |
Selects whether the Y values are discrete or continuous. |
Editing Transformer Parameters
Using a set of menu options, transformer parameters can be assigned by referencing other elements in the workspace. More advanced functions, such as an advanced editor and an arithmetic editor, are also available in some transformers. To access a menu of these options, click beside the applicable parameter. For more information, see Transformer Parameter Menu Options.
Defining Values
There are several ways to define a value for use in a Transformer. The simplest is to simply type in a value or string, which can include functions of various types such as attribute references, math and string functions, and workspace parameters. There are a number of tools and shortcuts that can assist in constructing values, generally available from the drop-down context menu adjacent to the value field.
Using the Text Editor
The Text Editor provides a convenient way to construct text strings (including regular expressions) from various data sources, such as attributes, parameters, and constants, where the result is used directly inside a parameter.
Using the Arithmetic Editor
The Arithmetic Editor provides a convenient way to construct math expressions from various data sources, such as attributes, parameters, and feature functions, where the result is used directly inside a parameter.
Conditional Values
Set values depending on one or more test conditions that either pass or fail.
Parameter Condition Definition Dialog
Content
Expressions and strings can include a number of functions, characters, parameters, and more.
When setting values - whether entered directly in a parameter or constructed using one of the editors - strings and expressions containing String, Math, Date/Time or FME Feature Functions will have those functions evaluated. Therefore, the names of these functions (in the form @<function_name>) should not be used as literal string values.
These functions manipulate and format strings. | |
Special Characters |
A set of control characters is available in the Text Editor. |
Math functions are available in both editors. | |
Date/Time Functions | Date and time functions are available in the Text Editor. |
These operators are available in the Arithmetic Editor. | |
These return primarily feature-specific values. | |
FME and workspace-specific parameters may be used. | |
Creating and Modifying User Parameters | Create your own editable parameters. |
Dialog Options - Tables
Transformers with table-style parameters have additional tools for populating and manipulating values.
Row Reordering
|
Enabled once you have clicked on a row item. Choices include:
|
Cut, Copy, and Paste
|
Enabled once you have clicked on a row item. Choices include:
Cut, copy, and paste may be used within a transformer, or between transformers. |
Filter
|
Start typing a string, and the matrix will only display rows matching those characters. Searches all columns. This only affects the display of attributes within the transformer - it does not alter which attributes are output. |
Import
|
Import populates the table with a set of new attributes read from a dataset. Specific application varies between transformers. |
Reset/Refresh
|
Generally resets the table to its initial state, and may provide additional options to remove invalid entries. Behavior varies between transformers. |
Note: Not all tools are available in all transformers.
FME Community
The FME Community is the place for demos, how-tos, articles, FAQs, and more. Get answers to your questions, learn from other users, and suggest, vote, and comment on new features.
Search for samples and information about this transformer on the FME Community.