Create plot insight¶
UI
·
interface
Create a new insight from the Plot section.
Usage¶
The following are the step's expected inputs and outputs and their specific types.
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 reference axis of the relative mode.
Must be one of:
"none"
,
"x"
,
"y"
segments: array[string]
Categories of the categorical column that are used to build the chart.
selectedChart: string
Useful to choose the chart kind to display in the UI.
Must be one of:
"Bar Chart"
,
"Box Plot Chart"
,
"Heat Map Chart"
,
"Line Chart"
,
"Relative Evolution Chart"
,
"Segmented 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: string
String containing a valid date.
label: string
Text of the comment.
bucketSizeCount: number
Number of time units that sets the size of the bucket.
bucketsSizeInterval: string
Time unit to specify the bucket size.
Must be one of:
"MILLISECOND"
,
"SECOND"
,
"MINUTE"
,
"HOUR"
,
"DAY"
,
"WEEK"
,
"MONTH"
,
"QUARTER"
,
"YEAR"
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"
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.
nBinsX: number
Number of bins in the x axis.
nBinsY: number
Number of bins in the y axis.
range: array[number | string]
Selection Range. This type is useful for quantitative columns, in which a selection of values in range can be made.
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
segmentsColumn: string
Categories are created from this column.
selection: string
A filter query. See Advanced query filters for more information.
sortX: string
Chart sorting applied to chart in the x axis.
Must be one of:
"XAXIS"
,
"YAXIS"
,
"SELECTION"
,
"ORDINAL"
,
"ALPHABET"
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"
,
"SELECTION"
,
"ORDINAL"
,
"ALPHABET"
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"
statsToShow: array[string]
Stats than can be added to the chart. Only median, mean, q1, q3 stats can be added.
Items in statsToShow
item: string
Must be one of:
"median"
,
"mean"
,
"q1"
,
"q3"
zoomX: {{ no such element: dict object['type'] }}
Selection applied to chart in the x axis. The chart will be zoom in over this selection.
zoomY: {{ no such element: dict object['type'] }}
Selection applied to chart in the y axis. The chart will be zoom in over this selection.