FME Transformers: 2024.2
FME Transformers: 2024.2
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
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
Output
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.
<Rejected>
When the transformer is non-blocking, features that cause the operation to fail are output through this port. When the transformer is blocking, input features are lost and a single new feature is output through this port. See Input Ports above for an explanation of when the ChartGenerator is blocking or non-blocking.
An fme_rejection_code attribute will be added to all rejected features, along with a more descriptive fme_rejection_message attribute which contains more specific details as to the reason for the rejection.
Rejected Feature Handling: can be set to either terminate the translation or continue running when it encounters a rejected feature. This setting is available both as a default FME option and as a workspace parameter.
Parameters
Group Processing
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 |
Select the point in processing at which groups are processed:
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. |
Chart Settings
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 |
|
Data Series
The parameters available here depend on the value of the Chart Type parameter. Parameters for each Chart Type are detailed below.
Bar
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. If colors are provided on individual features via the setting of the fme_color attribute, these values will override the color set here. Specifying Colors Colors may be entered directly or chosen from the color picker via the ellipsis button. Syntax
Colors can be specified by RGB values or hex codes. RGB values may be either 24-bit or decimal (0 - 1). If the value type is unclear, as in (1,1,1), the 24-bit interpretation is used. Hex codes are accepted with or without a hash sign (#).
|
||||||||||||||||||||
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. |
||||||||||||||||||||
Annotation |
Specifies an attribute whose value will be used to annotate a corresponding bar in the bar graph. Annotation is only applied if Data Attribute contains numeric count values and Data Label Attribute is not empty. Default annotation position is near the top (Vertical) or rightmost (Horizontal) edge of each bar. |
||||||||||||||||||||
Annotation X Offset (Pixels) |
Adjusts the horizontal position of the annotation, in pixels. Defaults is 0. |
||||||||||||||||||||
Annotation Y Offset (Pixels) |
Adjusts the vertical position of the annotation, in pixels. Defaults is 0. |
Histogram
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. Specifying Colors Colors may be entered directly or chosen from the color picker via the ellipsis button. Syntax
Colors can be specified by RGB values or hex codes. RGB values may be either 24-bit or decimal (0 - 1). If the value type is unclear, as in (1,1,1), the 24-bit interpretation is used. Hex codes are accepted with or without a hash sign (#).
|
||||||||||||||||||||
Trend Line |
Specifies whether a line fitting the histogram to a Gaussian will be shown. This option is disabled by default. |
Line
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. Specifying Colors Colors may be entered directly or chosen from the color picker via the ellipsis button. Syntax
Colors can be specified by RGB values or hex codes. RGB values may be either 24-bit or decimal (0 - 1). If the value type is unclear, as in (1,1,1), the 24-bit interpretation is used. Hex codes are accepted with or without a hash sign (#).
|
||||||||||||||||||||
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. |
||||||||||||||||||||
Annotation |
Specifies an attribute whose value will be used to annotate each point on the line graph. Annotation is only applied if Discrete X Values and Discrete Y Values are set to No. Default annotation position is near each point. |
||||||||||||||||||||
Annotation X Offset (Pixels) |
Adjusts the horizontal position of the annotation, in pixels. Defaults is 0. |
||||||||||||||||||||
Annotation Y Offset (Pixels) |
Adjusts the vertical position of the annotation, in pixels. Defaults is 0. |
Pie
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 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 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. |
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. |
Annotation |
Specifies an attribute whose value will be used to annotate a corresponding wedge in the pie graph. Annotation is only applied if Data Attribute contains numeric count values and Data Label Attribute is not empty. Default annotation position is near the middle of each wedge. |
Annotation X Offset (Pixels) |
Adjusts the horizontal position of the annotation, in pixels. Defaults is 0. |
Annotation Y Offset (Pixels) |
Adjusts the vertical position of the annotation, in pixels. Defaults is 0. |
Scatter
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. Specifying Colors Colors may be entered directly or chosen from the color picker via the ellipsis button. Syntax
Colors can be specified by RGB values or hex codes. RGB values may be either 24-bit or decimal (0 - 1). If the value type is unclear, as in (1,1,1), the 24-bit interpretation is used. Hex codes are accepted with or without a hash sign (#).
|
||||||||||||||||||||
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. |
||||||||||||||||||||
Annotation |
Specifies an attribute whose value will be used to annotate each point in the scatter graph. Annotation is only applied if Discrete X Values and Discrete Y Values are set to No. Default annotation position is near each point. |
||||||||||||||||||||
Annotation X Offset (Pixels) |
Adjusts the horizontal position of the annotation, in pixels. Defaults is 0. |
||||||||||||||||||||
Annotation Y Offset (Pixels) |
Adjusts the vertical position of the annotation, in pixels. Defaults is 0. |
Editing Transformer Parameters
Transformer parameters can be set by directly entering values, using expressions, or referencing other elements in the workspace such as attribute values or user parameters. Various editors and context menus are available to assist. To see what is available, click beside the applicable parameter.
How to Set Parameter Values
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.
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.
Content Types
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
Table Tools
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.
For more information, see Transformer Parameter Menu Options.
FME Community
The FME Community has a wealth of FME knowledge with over 20,000 active members worldwide. Get help with FME, share knowledge, and connect with users globally.
Search for all results about the ChartGenerator on the FME Community.