ChartGenerator
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.
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
Transformer
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.
Chart Settings
The chart type parameter determines the type of chart that will 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 currently include Pie, Bar, Histogram, Scatter and Line.
This parameter allows the user to set a title which will appear at the top of the chart.
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.
This parameter controls the placement of the legend relative to the chart. The default value is Auto Placement, when this option is selected the legend will be placed in a location that minimizes overlaps with data inside the chart. The “Inner” options allow placement within the chart axes, while the “Outer” options place the legend outside the chart axes.
This parameter sets the font used in the legend labels. Note that not all fonts available on your system will work with the underlying charting backend. If a certain font is not supported, it will be defaulted to Arial. The preview will also display a warning if you select an unsupported font. Note that if using FME Server, the fonts available on your server may be different than those available on your desktop.
Axes
For all Chart Types except Pie charts, additional Axes settings can be set, such as X Axis Label and Y Axis Label.
Sets the label along the X axis.
Sets the label along the Y axis.
Sets the font used for the X and Y Axis Labels.
The Ticks/Grid option allows the user to display tick marks when set to Ticks or gridlines along the axes when set to Grid or turn these off when set to None.
Sets the font used for the tick mark labels.
Further there are additional settings which can be set for each axis individually. These include:
Sets the minimum value for the X/Y axis. Note that setting this value may inadvertently crop data. If no value is specified, values will be determined so that all data is included within the limits.
Sets the maximum value for the X/Y axis. Note that setting this value may inadvertently crop data. If no value is specified, values will be determined so that all data is included within the limits.
Sets the spacing between ticks along the X/Y axis.
Allows each axis to be set to Linear or Logarithmic separately. Allows for the creation of logarithmic and semi-log plots.
Style
This parameter sets the font used in the title. Note that not all fonts available on your system will work with the underlying charting backend. If a certain font is not supported it will be defaulted to Arial. The preview will also display a warning if you select an unsupported font. Note that if using FME Server, the fonts available on your server may be different than those available on your desktop.
This parameter sets the chart-level line width used on the axes and the border of pie slices in pie charts. The default line width is set to 0.5.
This parameter sets the background color of the chart. The default background color is white, with an RGB value of 1.0,1.0,1.0.
Output
These parameters set the width and height of the output image in inches. The default image size is 2 inches by 2 inches with 300 dpi.
Note: Issues may occur if the output image size has a large discrepancy in width and height. As the preview is always a fixed maximum width or height, this ratio is capped at 1:5 to avoid rendering issues. If issues are seen at runtime, try adjusting the size, or making the width and height closer in value.
This parameter sets the dots per inch (dpi) resolution of the output image. The default image size is 2 inches by 2 inches with 300 dpi.
If RGB24 is selected, a 3 band RGB raster is output. If RGBA32 is selected, a 4 band raster with RGB and alpha will be output.
Data Series
The parameters available here depend on the value of the Chart Type parameter. Parameters for each Chart Type are detailed below.
Line
Specifies the attribute whose values will set the X coordinate of the vertices of the line.
Specifies the attribute whose values will set the Y coordinate of the vertices of the line.
Sets the value for the length of error bars corresponding to each vertex by choosing an attribute or list attribute.
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.
Sets the pattern on the line. Possible styles are Solid, Dashed, Dotted, and Dash-Dot.
Sets the thickness of the line.
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.
Scatter
Specifies the attribute whose values will set the X coordinate of each point in the scatter plot.
Specifies the attribute whose values will set the Y coordinate of each point in the scatter plot.
Sets the value for the length of error bars corresponding to each vertex by choosing an attribute or list attribute.
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.
Selects the shape of the icon at each point. Options include basic symbols such as circle, square, diamond and triangle.
Sets the size of the icon at each point.
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.
Histogram
Specifies an attribute whose numeric values will be binned to create the histogram.
Specifies the number of bins that will be created for the histogram.
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.
Specifies whether a line fitting the histogram to a Gaussian will be shown. This option is disabled by default.
Pie
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’.
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 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).
When this option is selected the percentage corresponding to the size of each wedge will be displayed.
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.
Bar
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’.
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.
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.
Controls the angle of the labels for the bars. Options include Horizontal, Vertical and Slanted.
Sets the chart orientation to be either Horizontal or Vertical.
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.
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.
Transformer Categories
FME Licensing Level
FME Professional edition and above
Technical History
Associated FME function or factory: PythonFactory
Search FME Community
Search for samples and information about this transformer on the FME Community.