Cartesian#
Cartesian #
Cartesian(
data: Union[DataType, DataFrame],
*,
widget_id: Optional[str] = None,
x_axis: Union[str, GenericLink, XAxis],
left_y_axis: Optional[Union[YAxisSeries, YAxis]] = None,
right_y_axis: Optional[
Union[YAxisSeries, YAxis]
] = None,
legend_position: LegendPosition = LegendPosition.BOTTOM,
title: WidgetTitleType = "",
enable_toolbar: bool = True
)
Spec for Cartesian widget.
Constructor for Cartesian widget.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
Union[DataType, DataFrame]
|
data to be used by widget. Accepts Storages as well as raw data. |
required |
widget_id |
Optional[str]
|
unique widget id in a dashboard. |
None
|
x_axis |
Union[str, GenericLink, XAxis]
|
spec for X Axis. |
required |
left_y_axis |
Optional[Union[YAxisSeries, YAxis]]
|
spec for left Y Axis. |
None
|
right_y_axis |
Optional[Union[YAxisSeries, YAxis]]
|
spec for right Y Axis |
None
|
legend_position |
LegendPosition
|
location of position relative to data, charts. |
BOTTOM
|
title |
WidgetTitleType
|
title of widget can be either a string (fixed value) or determined by a value from another widget using a WidgetLink. |
''
|
enable_toolbar |
bool
|
Enable/Disable toolbar flag. |
True
|
Examples:#
Create a minimal Cartesian widget
Components#
Construct charts and axes for Cartesian widget.
Construct different components such as charts and axes for a Cartesian widget.
Chart #
Chart(
x_axis: Union[str, GenericLink, XAxis],
*,
data: Optional[DataFrame] = None,
left_y_axis: Optional[Union[YAxisSeries, YAxis]] = None,
right_y_axis: Optional[Union[YAxisSeries, YAxis]] = None
)
Spec for charts in a Cartesian widget.
Construct a chart for a Cartesian widget.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
Optional[DataFrame]
|
Widget data. |
None
|
left_y_axis |
Optional[Union[YAxisSeries, YAxis]]
|
spec for left Y Axis. |
None
|
x_axis |
Union[str, GenericLink, XAxis]
|
spec for X Axis. |
required |
right_y_axis |
Optional[Union[YAxisSeries, YAxis]]
|
spec for right Y Axis. |
None
|
XAxis #
XAxis(
data_column: Union[str, GenericLink],
*,
title: Union[str, GenericLink] = "X",
enable_crosshair: bool = False,
formatting: Optional[AxisNumberFormatting] = None,
scale: Optional[AxisScale] = None
)
Specs for X Axis of a Cartesian chart.
Construct x axis for a Cartesian chart.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data_column |
Union[str, GenericLink]
|
name of column in pandas dataframe(s) used for X axis values. |
required |
title |
Union[str, GenericLink]
|
axis title |
'X'
|
enable_crosshair |
bool
|
whether to enable crosshair that follows either the mouse pointer or the hovered point. |
False
|
formatting |
Optional[AxisNumberFormatting]
|
formatting spec for axis labels. |
None
|
scale |
Optional[AxisScale]
|
X axis scale. |
None
|
YAxis #
YAxis(
series: YAxisSeries,
*,
title: Union[str, WidgetField] = "Y",
enable_crosshair: bool = False,
formatting: Optional[AxisNumberFormatting] = None,
scale: Optional[AxisScale] = None
)
Specs for Y Axis of a Cartesian chart.
Construct y axis for a Cartesian chart.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
series |
YAxisSeries
|
Add series to Y axis. |
required |
title |
Union[str, WidgetField]
|
axis title. |
'Y'
|
enable_crosshair |
bool
|
whether to enable crosshair that follows either the mouse pointer or the hovered point. |
False
|
formatting |
Optional[AxisNumberFormatting]
|
formatting spec for axis labels. |
None
|
scale |
Optional[AxisScale]
|
Y Axis scale. |
None
|
Examples:#
Create a minimal Cartesian widget with YAxis
LegendPosition #
Chart legend position options.
Options for positions of charts legend.
Attributes:
Name | Type | Description |
---|---|---|
RIGHT |
str
|
Legend is placed to the right of the chart. |
BOTTOM |
str
|
Legend is placed below the chart. |
RIGHT_GROUPED |
str
|
Legend is placed to the right of the chart and grouped with other legends. |
BOTTOM_GROUPED |
str
|
Legend is placed below the chart and grouped with other legends. |
NEXT_TO_DATA |
str
|
Legend is placed next to the data. |
Axis Scales#
Specify scaling for X and Y axes.
Specify the scaling behavior for the X and Y axes, including dynamic, symmetric, positive, and negative scales.
AxisScaleDynamic #
Dynamically set y-axis extremes for optimal spacing.
Construct specifications for a dynamic scale for the y-axis of a chart. By default, it dynamically calculates axis extremes to minimize dead space in the chart.
Constructor for AxisScaleDynamic.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
tick_amount |
int
|
number of ticks beyond min and max. |
3
|
AxisScaleSymmetric #
AxisScaleSymmetric(
*,
min_value: Optional[int] = None,
max_value: Optional[int] = None,
intermediate_tick_amount: int = 1,
strict: Optional[bool] = None
)
Y-axis scale for charts with positive and negative values.
Construct specifications for a scale for the y-axis with both positive and negative values. It determines extremes based on the maximum absolute value of the data, with 0 added as the middle tick.
Constructor for AxisScaleSymmetric.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
min_value |
Optional[int]
|
fixed minimum value for axis. Defaults to None (calculated dynamically). |
None
|
max_value |
Optional[int]
|
fixed maximum value for axis. Defaults to None (calculated dynamically). |
None
|
intermediate_tick_amount |
int
|
number of ticks between min-mid and between mid and max. Defaults to 1 (axis with five ticks) |
1
|
strict |
bool
|
Strict the Symmetry between the min and max value. Defaults to True. |
None
|
AxisScalePositive #
Y-axis scale for charts with positive values.
Construct specifications for a scale for the y-axis with only positive values. It assumes the minimum value of the chart to be fixed at 0. Specify a fixed maximum value for the axis with the max_value parameter, which defaults to None, allowing for dynamic calculation of the maximum value.
Constructor for AxisScalePositive.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
max_value |
Optional[int]
|
fixed maximum value for axis. Defaults to None (max value calculated dynamically) |
None
|
intermediate_tick_amount |
int
|
number of extra ticks between extremes. |
3
|
AxisScaleNegative #
Y-axis scale for charts with negative values.
Construct specifications for a scale for the y-axis with only negative values. It assumes the maximum value of the chart to be fixed at 0. Specify a fixed minimum value for the axis with the min_value parameter, which defaults to None, allowing for dynamic calculation of the minimum value.
Constructor for AxisScaleNegative.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
min_value |
Optional[int]
|
fixed minimum value for axis. Defaults to None (min value calculated dynamically) |
None
|
intermediate_tick_amount |
int
|
number of extra ticks between extremes. |
3
|
Series#
Define series types.
Define various types of series such as area, area range, bubble, column, line, and scatter for a Cartesian widget.
AreaSeries #
AreaSeries(
*,
data_column: Union[str, GenericLink],
x_data_column: Optional[Union[str, GenericLink]] = None,
formatting: Optional[NumberFormatting] = None,
name: Optional[Union[str, GenericLink]] = None,
styling: Optional[
Union[Palette, AreaSeriesStyling]
] = None,
entity: Optional[Entities] = None,
show_in_legend: bool = True,
required: bool = True,
visible: bool = True,
point_label_column: Optional[
Union[str, GenericLink]
] = None,
tooltips: Optional[TooltipItems] = None
)
Spec for a Area series of a Cartesian widget.
Construct area series.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data_column |
Union[str, GenericLink]
|
name of column in pandas dataframe(s) used for the values of this series for the Y Axis. |
required |
x_data_column |
Optional[Union[str, GenericLink]]
|
name of column in pandas dataframe(s) used for the values of this series for the X Axis. This column will override the data column defined in the X Axis instance. |
None
|
formatting |
Optional[NumberFormatting]
|
formatting spec for value associated with Y Axis. |
None
|
name |
Optional[Union[str, GenericLink]]
|
series name (shown in legend and tooltip). |
None
|
styling |
Optional[Union[Palette, AreaSeriesStyling]]
|
styling spec. |
None
|
entity |
Optional[Entities]
|
entity spec. |
None
|
show_in_legend |
bool
|
whether to show series in legend or not. |
True
|
required |
bool
|
Flag to make the Series mandatory. If required == True and no Data the widget will show an error. If required==False and no Data, the widget hides the Series. |
True
|
visible |
bool
|
Flag to make the Series visible when chart is loaded. |
True
|
point_label_column |
Optional[Union[str, GenericLink]]
|
name of column in dataframe(s) used for label of each point. |
None
|
tooltips |
Optional[TooltipItems]
|
tooltip items to be displayed at Series level. |
None
|
AreaRangeSeries #
AreaRangeSeries(
*,
low_data_column: Union[str, GenericLink],
high_data_column: Union[str, GenericLink],
x_data_column: Optional[Union[str, GenericLink]] = None,
formatting: Optional[NumberFormatting] = None,
name: Union[str, GenericLink],
styling: Optional[
Union[Palette, AreaRangeSeriesStyling]
] = None,
entity: Optional[Entities] = None,
show_in_legend: bool = True,
required: bool = True,
visible: bool = True,
point_label_column: Optional[
Union[str, GenericLink]
] = None,
tooltips: Optional[TooltipItems] = None
)
Spec for a area range series of a Cartesian widget.
Construct area range series.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
low_data_column |
Union[str, GenericLink]
|
name of column in pandas dataframe(s) used for the low values of this series. |
required |
high_data_column |
Union[str, GenericLink]
|
name of column in pandas dataframe(s) used for the high values of this series. |
required |
x_data_column |
Optional[Union[str, GenericLink]]
|
name of column in pandas dataframe(s) used for the values of this series for the X Axis. This column will override the data column defined in the X Axis instance. |
None
|
formatting |
Optional[NumberFormatting]
|
formatting spec for value associated with Y Axis. |
None
|
name |
Union[str, GenericLink]
|
series name (shown in legend and tooltip) |
required |
styling |
Optional[Union[Palette, AreaRangeSeriesStyling]]
|
styling spec. |
None
|
entity |
Optional[Entities]
|
entity spec. |
None
|
show_in_legend |
bool
|
whether to show series in legend or not. |
True
|
required |
bool
|
Flag to make the Series mandatory. If required == True and no Data the widget will show an error. If required==False and no Data, the widget hides the Series. |
True
|
visible |
bool
|
Flag to make the Series visible when chart is loaded. |
True
|
point_label_column |
Optional[Union[str, GenericLink]]
|
name of column in dataframe(s) used for label of each point. |
None
|
tooltips |
Optional[TooltipItems]
|
tooltip items to be displayed at Series level. |
None
|
BubbleSeries #
BubbleSeries(
*,
bubble_size_data_column: Union[str, GenericLink],
data_column: Union[str, GenericLink],
x_data_column: Optional[Union[str, GenericLink]] = None,
formatting: Optional[NumberFormatting] = None,
bubble_name: Optional[Union[str, GenericLink]] = None,
name: Optional[Union[str, GenericLink]] = None,
bubble_size_formatting: Optional[
NumberFormatting
] = None,
styling: Optional[
Union[Palette, BubbleSeriesStyling]
] = None,
entity: Optional[Entities] = None,
show_in_legend: bool = True,
required: bool = True,
visible: bool = True,
point_label_column: Optional[
Union[str, GenericLink]
] = None,
tooltips: Optional[TooltipItems] = None
)
Spec for a bubble series of a Cartesian widget.
Construct bubble series.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data_column |
Union[str, GenericLink]
|
name of column in pandas dataframe(s) used for the values of this series for the Y Axis. |
required |
x_data_column |
Optional[Union[str, GenericLink]]
|
name of column in pandas dataframe(s) used for the values of this series for the X Axis. This column will override the data column defined in the X Axis instance. |
None
|
formatting |
Optional[NumberFormatting]
|
formatting spec for value associated with Y Axis. |
None
|
name |
Optional[Union[str, GenericLink]]
|
series name (shown in legend and tooltip). |
None
|
bubble_name |
Optional[Union[str, GenericLink]]
|
name for the bubble value (show in tooltip). |
None
|
bubble_size_data_column |
Union[str, GenericLink]
|
name of column in pandas dataframe(s) used for the values of this series associated with the size of the bubble. |
required |
bubble_size_formatting |
Optional[NumberFormatting]
|
formatting spec for value associated with bubbles. |
None
|
styling |
Optional[Union[Palette, BubbleSeriesStyling]]
|
styling spec. |
None
|
entity |
Optional[Entities]
|
entity spec. |
None
|
show_in_legend |
bool
|
whether to show series in legend or not. |
True
|
required |
bool
|
Flag to make the Series mandatory. If required == True and no Data the widget will show an error. If required==False and no Data, the widget hides the Series. |
True
|
visible |
bool
|
Flag to make the Series visible when chart is loaded. |
True
|
point_label_column |
Optional[Union[str, GenericLink]]
|
name of column in dataframe(s) used for label of each point. |
None
|
tooltips |
Optional[TooltipItems]
|
tooltip items to be displayed at Series level. |
None
|
ColumnSeries #
ColumnSeries(
*,
data_column: Union[str, GenericLink],
x_data_column: Optional[Union[str, GenericLink]] = None,
formatting: Optional[NumberFormatting] = None,
name: Optional[Union[str, GenericLink]] = None,
styling: Optional[
Union[Palette, ColumnSeriesStyling]
] = None,
entity: Optional[Entities] = None,
show_in_legend: bool = True,
required: bool = True,
visible: bool = True,
point_label_column: Optional[
Union[str, GenericLink]
] = None,
tooltips: Optional[TooltipItems] = None
)
Spec for a column series of a Cartesian widget.
Construct column series.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data_column |
Union[str, GenericLink]
|
name of column in pandas dataframe(s) used for the values of this series for the Y Axis. |
required |
x_data_column |
Optional[Union[str, GenericLink]]
|
name of column in pandas dataframe(s) used for the values of this series for the X Axis. This column will override the data column defined in the X Axis instance. |
None
|
formatting |
Optional[NumberFormatting]
|
formatting spec for value associated with Y Axis. |
None
|
name |
Optional[Union[str, GenericLink]]
|
series name (shown in legend and tooltip). |
None
|
styling |
Optional[Union[Palette, ColumnSeriesStyling]]
|
styling spec. |
None
|
entity |
Optional[Entities]
|
entity spec. |
None
|
show_in_legend |
bool
|
whether to show series in legend or not. |
True
|
required |
bool
|
Flag to make the Series mandatory. If required == True and no Data the widget will show an error. If required==False and no Data, the widget hides the Series. |
True
|
visible |
bool
|
Flag to make the Series visible when chart is loaded. |
True
|
point_label_column |
Optional[Union[str, GenericLink]]
|
name of column in dataframe(s) used for label of each point. |
None
|
tooltips |
Optional[TooltipItems]
|
tooltip items to be displayed at Series level. |
None
|
LineSeries #
LineSeries(
*,
data_column: Union[str, GenericLink],
x_data_column: Optional[Union[str, GenericLink]] = None,
formatting: Optional[NumberFormatting] = None,
name: Optional[Union[str, GenericLink]] = None,
styling: Optional[
Union[Palette, LineSeriesStyling]
] = None,
entity: Optional[Entities] = None,
show_in_legend: bool = True,
required: bool = True,
visible: bool = True,
point_label_column: Optional[
Union[str, GenericLink]
] = None,
tooltips: Optional[TooltipItems] = None
)
Spec for a line series of a Cartesian widget.
Construct line series.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data_column |
Union[str, GenericLink]
|
name of column in pandas dataframe(s) used for the values of this series for the Y Axis. |
required |
x_data_column |
Optional[Union[str, GenericLink]]
|
name of column in pandas dataframe(s) used for the values of this series for the X Axis. This column will override the data column defined in the X Axis instance. |
None
|
formatting |
Optional[NumberFormatting]
|
formatting spec for value associated with Y Axis. |
None
|
name |
Optional[Union[str, GenericLink]]
|
series name (shown in legend and tooltip). |
None
|
styling |
Optional[Union[Palette, LineSeriesStyling]]
|
styling spec. |
None
|
entity |
Optional[Entities]
|
entity spec. |
None
|
show_in_legend |
bool
|
whether to show series in legend or not. |
True
|
required |
bool
|
Flag to make the Series mandatory. If required == True and no Data the widget will show an error. If required==False and no Data, the widget hides the Series. |
True
|
visible |
bool
|
Flag to make the Series visible when chart is loaded. |
True
|
point_label_column |
Optional[Union[str, GenericLink]]
|
name of column in dataframe(s) used for label of each point. |
None
|
tooltips |
Optional[TooltipItems]
|
tooltip items to be displayed at Series level. |
None
|
ScatterSeries #
ScatterSeries(
*,
data_column: Union[str, GenericLink],
x_data_column: Optional[Union[str, GenericLink]] = None,
formatting: Optional[NumberFormatting] = None,
name: Optional[Union[str, GenericLink]] = None,
entity: Optional[Entities] = None,
styling: Optional[
Union[Palette, ScatterSeriesStyling]
] = None,
show_in_legend: bool = True,
required: bool = True,
visible: bool = True,
point_label_column: Optional[
Union[str, GenericLink]
] = None,
tooltips: Optional[TooltipItems] = None
)
Spec for a scatter series of a Cartesian widget.
Construct scatter series.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data_column |
Union[str, GenericLink]
|
name of column in pandas dataframe(s) used for the values of this series for the Y Axis. |
required |
x_data_column |
Optional[Union[str, GenericLink]]
|
name of column in pandas dataframe(s) used for the values of this series for the X Axis. This column will override the data column defined in the X Axis instance. |
None
|
formatting |
Optional[NumberFormatting]
|
formatting spec for value associated with Y Axis. |
None
|
name |
Optional[Union[str, GenericLink]]
|
series name (shown in legend and tooltip). |
None
|
styling |
Optional[Union[Palette, ScatterSeriesStyling]]
|
styling spec. |
None
|
entity |
Optional[Entities]
|
entity spec. |
None
|
show_in_legend |
bool
|
whether to show series in legend or not. |
True
|
required |
bool
|
Flag to make the Series mandatory. If required == True and no Data the widget will show an error. If required==False and no Data, the widget hides the Series. |
True
|
visible |
bool
|
Flag to make the Series visible when chart is loaded. |
True
|
point_label_column |
Optional[Union[str, GenericLink]]
|
name of column in dataframe(s) used for label of each point. |
None
|
tooltips |
Optional[TooltipItems]
|
tooltip items to be displayed at Series level. |
None
|
Series Styling#
Style series appearance.
Style the appearance of different series types like area, area range, bubble, column, line, and scatter with customizable color specifications and marker symbols.
AreaSeriesStyling #
AreaSeriesStyling(
*,
color_spec: ColorSpec,
data_column: Optional[TemplatedStringItem] = None,
marker_symbol: MarkerSymbol = MarkerSymbol.CIRCLE
)
Customize appearance of filled areas in Charts.
Specify styling options for an area series within a Chart widget to customize the appearance of filled areas on the chart.
Constructor for AreaSeriesStyling.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
color_spec |
ColorSpec
|
spec for coloring area. |
required |
data_column |
Optional[TemplatedStringItem]
|
name of column in pandas dataframe(s) used for color spec if a gradient is used. Optional for single colors. |
None
|
marker_symbol |
MarkerSymbol
|
symbol for marker in tooltips and legends. |
CIRCLE
|
Raises:
Type | Description |
---|---|
ChartStylingMissingDataColumnError
|
if color_spec is ColorDiscreteMap/ColorGradient and data_column has not been specified |
AreaRangeSeriesStyling #
AreaRangeSeriesStyling(
*,
color_spec: ColorSpec,
data_column: Optional[TemplatedStringItem] = None,
marker_symbol: MarkerSymbol = MarkerSymbol.CIRCLE
)
Customize appearance of filled areas between values.
Specify styling specifications for an area range series within a Timeseries widget to customize the appearance of filled areas between low and high values on the chart.
Constructor for AreaRangeSeriesStyling.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
color_spec |
ColorSpec
|
spec for coloring area range. |
required |
data_column |
Optional[TemplatedStringItem]
|
name of column in pandas dataframe(s) used for color spec if a gradient is used. Optional for single colors. |
None
|
marker_symbol |
MarkerSymbol
|
symbol for marker in tooltips and legends. |
CIRCLE
|
Raises:
Type | Description |
---|---|
ChartStylingMissingDataColumnError
|
if color_spec is ColorDiscreteMap/ColorGradient and data_column has not been specified |
BubbleCircleSeriesStyling #
BubbleCircleSeriesStyling(
*,
color_spec: ColorSpec,
data_column: Optional[TemplatedStringItem] = None,
label_column: Optional[TemplatedStringItem] = None,
max_size_percentage: Optional[Union[int, float]] = 0.5,
min_size_percentage: Optional[Union[int, float]] = 0.2
)
Customize appearance of bubble markers.
Specify styling options for a bubble circle series within a Chart widget to customize the appearance of bubble markers on the chart.
Constructor for BubbleCircleSeriesStyling.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
color_spec |
ColorSpec
|
spec for coloring bubble. |
required |
data_column |
Optional[TemplatedStringItem]
|
name of column in pandas dataframe(s) used for color spec if a gradient is used. Optional for single colors. |
None
|
label_column |
Optional[TemplatedStringItem]
|
name of column in pandas dataframe(s) used for labeling the bubble. |
None
|
max_size_percentage |
Optional[Union[int, float]]
|
Percentage of the highest one of the plot width and height. |
0.5
|
min_size_percentage |
Optional[Union[int, float]]
|
Percentage of the smallest one of the plot width and height. |
0.2
|
Raises:
Type | Description |
---|---|
ChartStylingMissingDataColumnError
|
if color_spec is ColorDiscreteMap/ColorGradient and data_column has not been specified |
BubbleCountrySeriesStyling #
BubbleCountrySeriesStyling(
*,
country_column: TemplatedStringItem,
max_size_percentage: Optional[Union[int, float]] = 0.5,
min_size_percentage: Optional[Union[int, float]] = 0.2
)
Customize appearance of country bubble markers.
Specify styling options for a bubble country series within a Chart widget to customize the appearance of bubble markers representing countries on the chart.
Constructor for BubbleCountrySeriesStyling.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
country_column |
TemplatedStringItem
|
name of column in pandas dataframe(s) with country codes. |
required |
max_size_percentage |
Optional[Union[int, float]]
|
Percentage of the highest one of the plot width and height. |
0.5
|
min_size_percentage |
Optional[Union[int, float]]
|
Percentage of the smallest one of the plot width and height. |
0.2
|
ColumnSeriesStyling #
ColumnSeriesStyling(
*,
color_spec: ColorSpec,
data_column: Optional[TemplatedStringItem] = None,
marker_symbol: MarkerSymbol = MarkerSymbol.SQUARE
)
Customize appearance of vertical columns.
Specify styling options for a column series within a Chart widget to customize the appearance of vertical columns on the chart.
Constructor for ColumnSeriesStyling.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
color_spec |
ColorSpec
|
spec for coloring columns. |
required |
data_column |
Optional[TemplatedStringItem]
|
name of column in pandas dataframe(s) used for color spec if a gradient is used. Optional for single colors. |
None
|
marker_symbol |
MarkerSymbol
|
symbol for marker in tooltips and legends. |
SQUARE
|
Raises:
Type | Description |
---|---|
ChartStylingMissingDataColumnError
|
if a data_column is not defined when color_spec is a ColorDiscreteMap or ColorGradient |
LineSeriesStyling #
LineSeriesStyling(
*,
color_spec: Optional[ColorSpec] = None,
data_column: Optional[TemplatedStringItem] = None,
dash_style: Union[
DashStyle, TemplatedStringItem
] = DashStyle.SOLID,
marker_symbol: MarkerSymbol = MarkerSymbol.CIRCLE,
width: int = 2
)
Customize appearance of lines in Chart.
Specify styling options for a line series within a Chart widget to customize the appearance of the lines connecting data points on the chart.
Constructor for LineSeriesStyling.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
color_spec |
Optional[ColorSpec]
|
spec for coloring area. |
None
|
data_column |
Optional[TemplatedStringItem]
|
name of column in pandas dataframe(s) used for color spec if a gradient is used. Optional for single colors. |
None
|
dash_style |
Union[DashStyle, TemplatedStringItem]
|
dash style of line. |
SOLID
|
marker_symbol |
MarkerSymbol
|
symbol for marker in tooltips and legends. |
CIRCLE
|
width |
int
|
width of line. |
2
|
Raises:
Type | Description |
---|---|
ChartStylingMissingDataColumnError
|
if a data_column is not defined when color_spec is a ColorDiscreteMap or ColorGradient |
ScatterSeriesStyling #
ScatterSeriesStyling(
*,
color_spec: ColorSpec,
data_column: Optional[TemplatedStringItem] = None,
marker_symbol: MarkerSymbol = MarkerSymbol.CIRCLE
)
Customize appearance of scatter markers.
Specify styling options for a scatter series within a Timeseries widget to customize the appearance of individual data points represented as scatter markers on the chart.
Constructor for ScatterSeriesStyling.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
color_spec |
ColorSpec
|
spec for coloring columns. |
required |
data_column |
Optional[TemplatedStringItem]
|
name of column in pandas dataframe(s) used for color spec if a gradient is used. Optional for single colors. |
None
|
marker_symbol |
MarkerSymbol
|
symbol for each point. |
CIRCLE
|
Raises:
Type | Description |
---|---|
ChartStylingMissingDataColumnError
|
if a data_column is not defined when color_spec is a ColorDiscreteMap or ColorGradient |
Tooltips#
Tooltip content and formatting.
Specify the content and formatting of tooltips, including categories, datetime, numbers, and text.
CategoryTooltipItem #
CategoryTooltipItem(
*,
data_column: TemplatedStringItem,
formatting: MapperFormatting,
label: Optional[Union[str, DataField]] = None
)
Customize tooltips for categorical data in Chart widget.
Define specifications for a category tooltip item within a Chart widget to customize the appearance and content of tooltips displayed for categorical data.
Constructor for CategoryTooltipItem.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data_column |
TemplatedStringItem
|
name of column in pandas dataframe(s) used for the value of the tooltip item. |
required |
formatting |
MapperFormatting
|
tooltip formatting spec. |
required |
label |
Optional[Union[str, DataField]]
|
label to be used for tooltip item, it can be either a string or a DataField object. |
None
|
DatetimeTooltipItem #
DatetimeTooltipItem(
*,
data_column: TemplatedStringItem,
formatting: Optional[DateTimeFormatting] = None,
label: Optional[Union[str, DataField]] = None
)
Customize tooltips for datetime data in Chart.
Define specifications for a datetime item within a tooltip for a Chart widget to customize the appearance and content of tooltips displayed for datetime data.
Constructor for DatetimeTooltipItem.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data_column |
TemplatedStringItem
|
name of column in pandas dataframe(s) used for the value of the tooltip item. |
required |
formatting |
DateTimeFormatting
|
tooltip formatting spec Defaults to DateTimeFormatting for Dates (i.e. not include HH:MM). |
None
|
label |
Optional[Union[str, DataField]]
|
label to be used for tooltip item, it can be either a string or a DataField object. |
None
|
NumberTooltipItem #
NumberTooltipItem(
*,
data_column: TemplatedStringItem,
formatting: Optional[NumberFormatting] = None,
label: Optional[Union[str, DataField]] = None
)
Customize tooltips for numerical data in Chart.
Define specifications for a number item within a tooltip for a Chart widget to customize the appearance and content of tooltips displayed for numerical data.
Constructor for NumberTooltipItem.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data_column |
TemplatedStringItem
|
name of column in pandas dataframe(s) used for the value of the tooltip item. |
required |
formatting |
Optional[NumberFormatting]
|
tooltip formatting spec. Defaults to None (Base NumberFormatting). |
None
|
label |
Optional[Union[str, DataField]]
|
label to be used for tooltip item, it can be either a string or a DataField object. |
None
|
TextTooltipItem #
TextTooltipItem(
*,
data_column: TemplatedStringItem,
formatting: Optional[TextFormatting] = None,
label: Optional[Union[str, DataField]] = None
)
Customize tooltips for textual data in Chart.
Define specifications for a text item within a tooltip for a Chart widget to customize the appearance and content of tooltips displayed for textual data.
Constructor for TextTooltipItem.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data_column |
TemplatedStringItem
|
name of column in pandas dataframe(s) used for the value of the tooltip item. |
required |
formatting |
Optional[TextFormatting]
|
tooltip formatting spec. Defaults to TextFormatting(max_characters=30). |
None
|
label |
Optional[Union[str, DataField]]
|
label to be used for tooltip item, it can be either a string or a DataField object. |
None
|