Skip to content

Create plot insight

UIinterface

Create a new insight from the Plot section.

Usage


The following are the step's expected inputs and outputs and their specific types.

Step signature
create_plot_insight({"param": value})

where the object {"param": value} is optional in most cases and if present may contain any of the parameters described in the corresponding section below.

Parameters


relative: boolean

Sets the visualization type to absolute or relative.


relativeCount: string

Sets the relativeCount mode.

Must be one of: "none", "relative", "x", "y"


selectedChart: string

Useful to choose the chart kind to display in the UI.

Must be one of: "Area Chart", "Bar Chart", "Box Plot Chart", "Bubble Chart", "Bubble Colored Chart", "Grouped Bar Chart", "Heat Map Chart", "Line Chart", "Multiple Line Chart", "Scatterplot Chart", "Scatterplot Colored Chart", "Seasonal Decomposition Chart", "Segmented Area Chart", "Segmented Bar Chart", "Segmented Line Chart", "Stacked Area Chart", "Stacked Bar Chart", "Stacked 100% Area Chart", "Stacked 100% Bar Chart"


title: string

Title of the insight.


xColumn: string

Column represented in the x axis.


yColumn: string

Column represented in the y axis.


annotations: array[object]

Comments that can be added to the chart. Any text can be added as annotation at certain abscissa point.

Items in annotations

at: number | string

Abscissa point where the annotation is placed.


label: string

Text of the comment.


barPaddings: object

Bars paddings in Bar charts. Defines the inner & outer paddings for bars in Bar charts.

Items in barPaddings

inner: number

Inner padding between bars.


outer: number

Outer padding for bars.


boxPlotStat: string

Defines the metrics to be drawn in a BoxPlot chart.

Must be one of: "quartiles", "quartiles+IQR", "quartiles+min/max", "mean+standardDeviation"


bucketSizeCount: number

Number of time units that sets the size of the bucket.


bucketSizeInterval: string

Time unit to specify the bucket size.

Must be one of: "MILLISECOND", "SECOND", "MINUTE", "HOUR", "DAY", "WEEK", "MONTH", "QUARTER", "YEAR"


chartDescription: string

Chart description.


chartDirection: string

Defines the direction in which the chart is drawn. Defines if Bar or BoxPlot charts will be drawn horizontally or vertically.

Must be one of: "horizontal", "vertical"


chartFooter: string

Chart footer text.


chartSize: object

Chart size. Chart width & height if customized, undefined if in "Fit to screen" mode.

Items in chartSize

width: number

Chart size width.


height: number

Chart size height.


chartSubtitle: string

Chart subtitle.


chartTitle: string

Chart title.


elements: array[object]

Type and appearance of an insight's elements. A list in which each item is an object configuring the appearance of a particular insight element.

Items in elements

kind: string

Specify the type of element.

Must be one of: "TITLE", "DESCRIPTION", "CHART", "GRAPH", "STATS", "LEGEND", "LEGEND_COLOR_SCALE"


text: string

The text shown for this insight element.


layout: object

The element's position and size. The position refers to the top-left corner of the rectangle representing the insight element, while the size is given by its width and height. For reference, the entire insight is 12 units wide and 9 units high, and the origin (0, 0) of the x/y coordinates is in its top-left corner.

Items in layout

x: integer

Horizontal position of the element's top-left corner. In increments of 1; 0 being the left-most and 8 the right-most position.

Range: -1 ≤ x ≤ 11


y: integer

Vertical position of the element's top-left corner. In increments of 1; 0 being the top-most and 11 the bottom-most position.

Range: 0 ≤ y ≤ 11


w: integer

The width of the element (in increments of 1).

Range: 1 ≤ w ≤ 12


h: integer

The height of the element (in increments of 1).

Range: 1 ≤ h ≤ 9


column: string

Name of the column containing the data to be used in this insight element. Required if the element is of type CHART or STATS.


filterMode: boolean

Defines if the categories must filter or not. If "true", the categories of the categoricalColumn will act as filters.


foregroundColor: string

Chart markers foregroundColor.


hideLegendColorTitle: boolean

Hides chart color legend title.


hideLegendSizeTitle: boolean

Hides chart size legend title.


hideXTitle: boolean

Hides chart X axis title.


hideYTitle: boolean

Hides chart Y axis title.


labels: object

Chart value labels. Show & configure value labels in some charts.

Items in labels

column: string

Column for node labels in scatterplot charts.


config: object

Style configurations for value labels in bar charts. Set position & alignment configuration for value labels in bar charts.

Items in config

position: string

Value labels position in bar charts.

Must be one of: "inside", "outside"


alignment: string

Value labels alignment in horizontal bar charts.

Must be one of: "left", "middle", "right"


format: string

Format for value labels.


margin: number

Margin between node labels in scatterplot charts.


show: boolean

Whether to show value labels.


showTotal: boolean

Whether to show total value labels in stacked bar charts.


stats: array[string]

Metrics to show as value labels in boxplot charts.


legendColorTitle: string

Chart color legend title.


legendSizeTitle: string

Chart size legend title.


nBinsX: number

Number of bins in the x axis.


nBinsXDirection: string

Get top (DESC) or bottom (ASC) categories for categorical variables in the x axis.

Must be one of: "ASC", "DESC"


nBinsY: number

Number of bins in the y axis.


nBinsYDirection: string

Get top (DESC) or bottom (ASC) categories for categorical variables in the y axis.

Must be one of: "ASC", "DESC"


opacity: number

Nodes opacity in scatterplot charts.


recurrentPeriod: string

Time unit to specify the period for Recurrent Patterns aggregation.

Must be one of: "MILLISECOND", "SECOND", "MINUTE", "HOUR", "MONTH_DAY", "WEEK_DAY", "WEEK", "MONTH", "QUARTER", "YEAR"


replayDisabled: string | boolean = False

Indicates if the insight can replay its original state or not.

Must be one of: "drillDown", "directSelectionInGraph", "nonPersistedColumn", True, False


scatterplotMetrics: object

Metrics shown in scatterplot charts. Defines if regression line, RSquared or Pearson coefficient metrics are displayed.

Items in scatterplotMetrics

showRegressionLine: boolean

Whether to show a regression line.


showRSquared: boolean

Whether to show RSquared metric.


showPearson: boolean

Whether to show Pearson coefficient metric.


seasonalityInterval: number

Seasonality interval for Seasonal Decomposition plot.


segmentExpanded: string

expanded segment in Seasonal Decomposition plot.


segments: array[string]

Categories of the categorical column that are used to build the chart.


segmentsColumn: string

Categories are created from this column.


selection: string

A filter query. See Advanced query filters for more information.


size: number | object

Nodes size in scatterplot charts. Can define a fixed value or a min & max value in px to map nodes size.

Items in size

sizeColumn: string

Column that maps bubble size in scatterplot charts.


sortX: string

Chart sorting applied to chart in the x axis.

Must be one of: "XAXIS", "YAXIS", "YAXIS_SEGMENT", "SELECTION", "ORDINAL", "ALPHANUM"


sortXDirection: string

Chart sorting direction applied to chart in the x axis.

Must be one of: "ASC", "DESC"


sortY: string

Chart sorting applied to chart in the y axis.

Must be one of: "XAXIS", "YAXIS", "YAXIS_SEGMENT", "SELECTION", "ORDINAL", "ALPHANUM"


sortYDirection: string

Chart sorting direction applied to chart in the y axis.

Must be one of: "ASC", "DESC"


stat: string

Stat kind.

Must be one of: "sum", "mean", "variance", "standardDeviation", "skewness", "kurtosis", "min", "p25", "p50", "p75", "max", "nNulls", "precision", "count", "cumSum", "nodeCount", "rForeground", "valueCount"


statsToShow: array[string]

Stats than can be added to the chart. Only mean, p25, p50 & p75 stats can be added.

Items in statsToShow

item: string

Must be one of: "mean", "p25", "p50", "p75"


theme: string = "graphext"

Theme applied to the chart.

Must be one of: "graphext", "dark", "excel", "fivethirtyeight", "ggplot2", "googlecharts", "latimes", "powerbi", "quartz", "urbaninstitute", "vox"


themeColorPalette: string

Theme color palette applied to the chart when the theme is graphext.

Must be one of: "Horus", "Osiris", "Re"


themeMode: string = "dark"

Theme mode applied to the chart.

Must be one of: "dark", "light"


tooltip: boolean

Defines if tooltip is enabled.


tooltipFields: array[string]

Fields in tooltip. A list of fields to show in tooltip for Scatterplot charts.


xAxisConfig: object

Axis config options. X or Y axes config options.

Items in xAxisConfig

includeZero: boolean

Whether to include zero in the axe or not.


isLogarithmic: boolean

Whether to use a logarithmic scale.


xDomain: array[number] | array[string]

Chart X scale domain for Scatterplot charts. Scatterplot charts need to define axes scales domain.


xTitle: string

Chart X axis title.


yAxisConfig: object

Axis config options. X or Y axes config options.

Items in yAxisConfig

includeZero: boolean

Whether to include zero in the axe or not.


isLogarithmic: boolean

Whether to use a logarithmic scale.


yDomain: array[number] | array[string]

Chart Y scale domain for Scatterplot charts. Scatterplot charts need to define axes scales domain.


yTitle: string

Chart Y axis title.


zoomX: array[number] | array[string]

Selection applied to chart in the x axis. The chart will be zoom in over this selection.


zoomY: array[number] | array[string]

Selection applied to chart in the y axis. The chart will be zoom in over this selection.