plot¶
- class virtualitics_sdk.elements.plot.Plot(title, _type, x_axis, y_axis, data, has_tooltip, data_keys, description='', color_by=None, show_title=True, show_description=True, colors=None, advanced_tooltip=None, lines=[], legend=None, **kwargs)¶
Bases:
Element
A VAIP Plot instance.
To see usage of the Plot class look to
viz_utils
where plots are generated with utility functions.- Parameters:
title (
str
) – The title of the blot._type (
PlotType
) – The type of plot (can be “scatter”, “bar”, or “line”).x_axis (
XAxis
) – The X-Axis.y_axis (
YAxis
) – The Y-Axis.data (
List
[PlotDataPoint
]) – The data points needed for the plot.has_tooltip (
bool
) – Whether this plot should show a tooltip.data_keys (
Dict
[str
,PlotDataKey
]) – The keys within data point that should be rendered as the values.description (
str
) – The description of this plot, defaults to ‘’.color_by (
Optional
[str
]) – The column to use to color the plot if coloring, defaults to None (no coloring).show_title (
bool
) – Whether to show the title on the page when rendered, defaults to True.show_description (
bool
) – Whether to show the description to the page when rendered, defaults to True.colors (
Optional
[List
[str
]]) – The colors schema a plot should use, defaults to None (Predict default colors).advanced_tooltip (
Optional
[Callable
[[dict
],List
[Union
[Element
,str
]]]]) – The function to call that create an advanced tooltip. This functions takes a dict containing the data point and returns a list of elements (Plots, Infographics Tables, Infographics, CustomEvents) or strings which are rendered as markdown, defaults to Nonelines (
List
[Line
]) – A list of Line objects that will be displayed in the plot. See documentation for each type of Line class for more information, defaults to None.legend (
Optional
[List
[str
]]) – The explicit order for the legend of a categorical plot. If not set, the legend will be automatically determined from the plot’s data
- static is_valid_plot_type(s)¶
- Return type:
bool
- to_json()¶
Convert the element to a JSON.
- Returns:
A JSON dictionary of the element.
- class virtualitics_sdk.elements.plot.PlotAxisScale(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
Enum
- AUTO = 'auto'¶
- BAND = 'band'¶
- IDENTITY = 'identity'¶
- LINEAR = 'linear'¶
- LOGARITHMIC = 'log'¶
- ORDINAL = 'ordinal'¶
- POINT = 'point'¶
- POW = 'pow'¶
- QUANTILE = 'quantile'¶
- QUANTIZE = 'quantize'¶
- SEQUENTIAL = 'sequential'¶
- SQUARE_ROOT = 'sqrt'¶
- THRESHOLD = 'threshold'¶
- TIME = 'time'¶
- UTC = 'utc'¶
- class virtualitics_sdk.elements.plot.PlotDataKey(_type, domain, tooltip, color=None, legend=None)¶
Bases:
object
- to_json()¶
- class virtualitics_sdk.elements.plot.PlotType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
Enum
- BAR = 'bar'¶
- LINE = 'line'¶
- PLOTLY = 'plotly'¶
- SCATTER = 'scatter'¶
- WATERFALL = 'waterfall'¶
- class virtualitics_sdk.elements.plot.XAxis(orientation, scale, label, data_key, domain=None)¶
Bases:
object
- to_json()¶
- class virtualitics_sdk.elements.plot.XAxisOrientation(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
Enum
- BOTTOM = 'bottom'¶
- TOP = 'top'¶