.pie
class: PieSeries
- class PieSeries(**kwargs)[source]
Options to configure a Pie series.
A pie chart is a circular graphic which is divided into slices to illustrate numerical proportion.
Class Inheritance
- copy(other=None, overwrite=True, **kwargs)
Copy the configuration settings from this instance to the
other
instance.- Parameters:
other (
HighchartsMeta
) – The target instance to which the properties of this instance should be copied. IfNone
, will create a new instance and populate it with properties copied fromself
. Defaults toNone
.overwrite (
bool
) – ifTrue
, properties inother
that are already set will be overwritten by their counterparts inself
. Defaults toTrue
.kwargs – Additional keyword arguments. Some special descendents of
HighchartsMeta
may have special implementations of this method which rely on additional keyword arguments.
- Returns:
A mutated version of
other
with new property values
- classmethod from_csv(as_string_or_file, property_column_map, has_header_row=True, series_kwargs=None, delimiter=',', null_text='None', wrapper_character="'", line_terminator='\r\n', wrap_all_strings=False, double_wrapper_character_when_nested=False, escape_character='\\')
Create a new series instance with a
.data
property populated from data in a CSV string or file.Note
For an example
LineSeries
, the minimum code required would be:my_series = LineSeries.from_csv('some-csv-file.csv', property_column_map = { 'x': 0, 'y': 3, 'id': 'id' })
As the example above shows, data is loaded into the
my_series
instance from the CSV file with a filenamesome-csv-file.csv
. Thex
values for each data point will be taken from the first (index 0) column in the CSV file. They
values will be taken from the fourth (index 3) column in the CSV file. And theid
values will be taken from a column whose header row is labeled'id'
(regardless of its index).- Parameters:
as_string_or_file (
str
or Path-like) –The CSV data to use to pouplate data. Accepts either the raw CSV data as a
str
or a path to a file in the runtime environment that contains the CSV data.Tip
Unwrapped empty column values are automatically interpreted as null (
None
).property_column_map (
dict
) –A
dict
used to indicate which data point property should be set to which CSV column. The keys in thedict
should correspond to properties in the data point class, while the value can either be a numerical index (starting with 0) or astr
indicating the label for the CSV column.has_header_row (
bool
) – IfTrue
, indicates that the first row ofas_string_or_file
contains column labels, rather than actual data. Defaults toTrue
.series_kwargs (
dict
) –An optional
dict
containing keyword arguments that should be used when instantiating the series instance. Defaults toNone
.Warning
If
series_kwargs
contains adata
key, its value will be overwritten. Thedata
value will be created from the CSV file instead.delimiter (
str
) – The delimiter used between columns. Defaults to,
.wrapper_character (
str
) – The string used to wrap string values when wrapping is applied. Defaults to'
.null_text (
str
) – The string used to indicate an empty value if empty values are wrapped. Defaults to None.line_terminator (
str
) – The string used to indicate the end of a line/record in the CSV data. Defaults to'\r\n'
.line_terminator –
The string used to indicate the end of a line/record in the CSV data. Defaults to
'\r\n'
.Note
The Python
csv
currently ignores theline_terminator
parameter and always applies'\r\n'
, by design. The Python docs say this may change in the future, so for future backwards compatibility we are including it here.wrap_all_strings (
bool
) –If
True
, indicates that the CSV file has all string data values wrapped in quotation marks. Defaults toFalse
.double_wrapper_character_when_nested (
bool
) – IfTrue
, quote character is doubled when appearing within a string value. IfFalse
, theescape_character
is used to prefix quotation marks. Defaults toFalse
.escape_character (
str
) – A one-character string that indicates the character used to escape quotation marks if they appear within a string value that is already wrapped in quotation marks. Defaults to\\
(which is Python for'\'
, which is Python’s native escape character).
- Returns:
A series instance (descended from
SeriesBase
) with its.data
property populated from the CSV data inas_string_or_file
.- Return type:
list
of series instances (descended fromSeriesBase
)- Raises:
HighchartsCSVDeserializationError – if
property_column_map
references CSV columns by their label, but the CSV data does not contain a header row
- classmethod from_dict(as_dict: dict, allow_snake_case: bool = True)
Construct an instance of the class from a
dict
object.
- classmethod from_geopandas(gdf, property_map, series_kwargs=None)
Create a series instance whose
.data
property is populated from a geopandasGeoDataFrame
.- Parameters:
gdf (
GeoDataFrame
) – TheGeoDataFrame
from which data should be loaded.property_map (
dict
) – Adict
used to indicate which data point property should be set to which column ingdf
. The keys in thedict
should correspond to properties in the data point class, while the value should indicate the label for theGeoDataFrame
column.series_kwargs (
dict
) –An optional
dict
containing keyword arguments that should be used when instantiating the series instance. Defaults toNone
.Warning
If
series_kwargs
contains adata
ormap_data
key, their values will be overwritten. Thedata
andmap_data
values will be created fromgdf
instead.
- Returns:
A series instance (descended from
MapSeriesBase
) with its.data
and.map_data
properties from the data ingdf`
- Return type:
list
of series instances (descended fromMapSeriesBase
)- Raises:
HighchartsPandasDeserializationError – if
property_map
references a column that does not exist in the data frameHighchartsDependencyError – if geopandas is not available in the runtime environment
- classmethod from_js_literal(as_str_or_file, allow_snake_case: bool = True, _break_loop_on_failure: bool = False)
Return a Python object representation of a Highcharts JavaScript object literal.
- Parameters:
as_str_or_file (
str
) – The JavaScript object literal, represented either as astr
or as a filename which contains the JS object literal.allow_snake_case (
bool
) – IfTrue
, interpretssnake_case
keys as equivalent tocamelCase
keys. Defaults toTrue
._break_loop_on_failure (
bool
) – IfTrue
, will break any looping operations in the event of a failure. Otherwise, will attempt to repair the failure. Defaults toFalse
.
- Returns:
A Python object representation of the Highcharts JavaScript object literal.
- Return type:
HighchartsMeta
- classmethod from_json(as_json_or_file, allow_snake_case: bool = True)
Construct an instance of the class from a JSON string.
- Parameters:
as_json_or_file – The JSON string for the object or the filename of a file that contains the JSON string.
allow_snake_case (
bool
) – IfTrue
, interpretssnake_case
keys as equivalent tocamelCase
keys. Defaults toTrue
.
- Returns:
A Python objcet representation of
as_json
.- Return type:
HighchartsMeta
- classmethod from_pandas(df, property_map, series_kwargs=None)
Create a series instance whose
.data
property is populated from a pandasDataFrame
.- Parameters:
df (
DataFrame
) – TheDataFrame
from which data should be loaded.property_map (
dict
) – Adict
used to indicate which data point property should be set to which column indf
. The keys in thedict
should correspond to properties in the data point class, while the value should indicate the label for theDataFrame
column.series_kwargs (
dict
) –An optional
dict
containing keyword arguments that should be used when instantiating the series instance. Defaults toNone
.Warning
If
series_kwargs
contains adata
key, its value will be overwritten. Thedata
value will be created fromdf
instead.
- Returns:
A series instance (descended from
SeriesBase
) with its.data
property populated from the data indf
.- Return type:
list
of series instances (descended fromSeriesBase
)- Raises:
HighchartsPandasDeserializationError – if
property_map
references a column that does not exist in the data frameif pandas is not available in the runtime environment
- classmethod from_pyspark(df, property_map, series_kwargs=None)
Create a series instance whose
.data
property is populated from a PySparkDataFrame
.- Parameters:
df (
DataFrame
) – TheDataFrame
from which data should be loaded.property_map (
dict
) – Adict
used to indicate which data point property should be set to which column indf
. The keys in thedict
should correspond to properties in the data point class, while the value should indicate the label for theDataFrame
column.series_kwargs (
dict
) –An optional
dict
containing keyword arguments that should be used when instantiating the series instance. Defaults toNone
.Warning
If
series_kwargs
contains adata
key, its value will be overwritten. Thedata
value will be created fromdf
instead.
- Returns:
A series instance (descended from
SeriesBase
) with its.data
property populated from the data indf
.- Return type:
list
of series instances (descended fromSeriesBase
)- Raises:
HighchartsPySparkDeserializationError – if
property_map
references a column that does not exist in the data frameif PySpark is not available in the runtime environment
- load_from_csv(as_string_or_file, property_column_map, has_header_row=True, delimiter=',', null_text='None', wrapper_character="'", line_terminator='\r\n', wrap_all_strings=False, double_wrapper_character_when_nested=False, escape_character='\\')
Replace the existing
.data
property with a new value populated from data in a CSV string or file.Note
For an example
LineSeries
, the minimum code required would be:my_series = LineSeries() my_series = my_series.from_csv('some-csv-file.csv', property_column_map = { 'x': 0, 'y': 3, 'id': 'id' })
As the example above shows, data is loaded into the
my_series
instance from the CSV file with a filenamesome-csv-file.csv
. Thex
values for each data point will be taken from the first (index 0) column in the CSV file. They
values will be taken from the fourth (index 3) column in the CSV file. And theid
values will be taken from a column whose header row is labeled'id'
(regardless of its index).- Parameters:
as_string_or_file (
str
or Path-like) –The CSV data to use to pouplate data. Accepts either the raw CSV data as a
str
or a path to a file in the runtime environment that contains the CSV data.Tip
Unwrapped empty column values are automatically interpreted as null (
None
).property_column_map (
dict
) –A
dict
used to indicate which data point property should be set to which CSV column. The keys in thedict
should correspond to properties in the data point class, while the value can either be a numerical index (starting with 0) or astr
indicating the label for the CSV column.has_header_row (
bool
) – IfTrue
, indicates that the first row ofas_string_or_file
contains column labels, rather than actual data. Defaults toTrue
.delimiter (
str
) – The delimiter used between columns. Defaults to,
.wrapper_character (
str
) – The string used to wrap string values when wrapping is applied. Defaults to'
.null_text (
str
) – The string used to indicate an empty value if empty values are wrapped. Defaults to None.line_terminator (
str
) – The string used to indicate the end of a line/record in the CSV data. Defaults to'\r\n'
.line_terminator –
The string used to indicate the end of a line/record in the CSV data. Defaults to
'\r\n'
.Note
The Python
csv
currently ignores theline_terminator
parameter and always applies'\r\n'
, by design. The Python docs say this may change in the future, so for future backwards compatibility we are including it here.wrap_all_strings (
bool
) –If
True
, indicates that the CSV file has all string data values wrapped in quotation marks. Defaults toFalse
.double_wrapper_character_when_nested (
bool
) – IfTrue
, quote character is doubled when appearing within a string value. IfFalse
, theescape_character
is used to prefix quotation marks. Defaults toFalse
.escape_character (
str
) – A one-character string that indicates the character used to escape quotation marks if they appear within a string value that is already wrapped in quotation marks. Defaults to\
(which is Python for''
, which is Python’s native escape character).
- Raises:
HighchartsCSVDeserializationError – if
property_column_map
references CSV columns by their label, but the CSV data does not contain a header row
- load_from_geopandas(gdf, property_map)
Replace the contents of the
.data
property with data points and the.map_data
property with geometries populated from a geopandasGeoDataFrame
.- Parameters:
gdf (
GeoDataFrame
) – TheGeoDataFrame
from which data should be loaded.property_map (
dict
) – Adict
used to indicate which data point property should be set to which column ingdf
. The keys in thedict
should correspond to properties in the data point class, while the value should indicate the label for theGeoDataFrame
column.
- Raises:
HighchartsPandasDeserializationError – if
property_map
references a column that does not exist in the data frameHighchartsDependencyError – if geopandas is not available in the runtime environment
- load_from_pandas(df, property_map)
Replace the contents of the
.data
property with data points populated from a pandasDataFrame
.- Parameters:
df (
DataFrame
) – TheDataFrame
from which data should be loaded.property_map (
dict
) – Adict
used to indicate which data point property should be set to which column indf
. The keys in thedict
should correspond to properties in the data point class, while the value should indicate the label for theDataFrame
column.
- Raises:
HighchartsPandasDeserializationError – if
property_map
references a column that does not exist in the data frameif pandas is not available in the runtime environment
- load_from_pyspark(df, property_map)
Replaces the contents of the
.data
property with values from a PySparkDataFrame
.- Parameters:
df (
DataFrame
) – TheDataFrame
from which data should be loaded.property_map (
dict
) – Adict
used to indicate which data point property should be set to which column indf
. The keys in thedict
should correspond to properties in the data point class, while the value should indicate the label for theDataFrame
column.
- Raises:
HighchartsPySparkDeserializationError – if
property_map
references a column that does not exist in the data frameif PySpark is not available in the runtime environment
- set_async_map_data(url, selector=None, fetch_config=None)
Configures the asynchronous loading of map geometries for the series, including a download of the raw map data itself in TopoJSON or GeoJSON format and the incorporation of an (optional) custom JavaScript function to select a portion of the downloaded data for rendering.
- Parameters:
url (
str
) – The URL from which to retrieve the map geometry asynchronously via a JavaScriptfetch()
call.selector (
CallbackFunction
) –A JavaScript callback function that the map geometry retrieved from
url
will be supplied to, and which will then return a subset or mutated form of the resulting data. Defaults toNone
.Caution
The function must expect a single argument named
originalMapData
.fetch_config (
FetchConfiguration
orNone
) –Additional (optional) configuration settings to use for the JavaScript
fetch()
function call. Defaults toNone
.Note
If
fetch_config
contains an already-set URL, that URL will be overwritten by the value supplied inurl
.
- to_dict() dict
Generate a
dict
representation of the object compatible with the Highcharts JavaScript library.Note
The
dict
representation has a property structure and naming convention that is intentionally consistent with the Highcharts JavaScript library. This is not Pythonic, but it makes managing the interplay between the two languages much, much simpler.
- to_js_literal(filename=None, encoding='utf-8') str | None
Return the object represented as a
str
containing the JavaScript object literal.
- to_json(filename=None, encoding='utf-8')
Generate a JSON string/byte string representation of the object compatible with the Highcharts JavaScript library.
Note
This method will either return a standard
str
or abytes
object depending on the JSON serialization library you are using. For example, if your environment has orjson, the result will be abytes
representation of the string.- Parameters:
- Returns:
A JSON representation of the object compatible with the Highcharts library.
- Return type:
- static trim_dict(untrimmed: dict, to_json: bool = False) dict
Remove keys from
untrimmed
whose values areNone
and convert values that have.to_dict()
methods.
- static trim_iterable(untrimmed, to_json=False)
Convert any
EnforcedNullType
values inuntrimmed
to'null'
.
- property accessibility: TypeOptionsAccessibility | None
Accessibility options for a series.
- Return type:
TypeOptionsAccessibility
orNone
- property all_areas: bool | None
If
True
, all areas defined in the map’s.map_data
should be rendered, with areas that do not have a related data point rendered as null values. IfFalse
, areas of the map that do not have a related data point are skipped and not rendered. Defaults toTrue
.
- property allow_point_select: bool | None
Allow this series’ points to be selected by clicking on the graphic (columns, point markers, pie slices, map areas etc).
The selected points can be handled in JavaScript by point select and unselect events, or collectively by the (JavaScript)
getSelectedPoints()
function.And alternative way of selecting points is through dragging.
Defaults to
False
.
- property animation: AnimationOptions | None
Enable or disable the initial animation when a series is displayed.
The animation can also be set as a configuration object. Please note that this option only applies to the initial animation of the series itself. For other animations, see
Chart.animation
and theanimation
parameter under the (JavaScript) API methods. The following properties are supported:defer
: The animation delay time in milliseconds.duration
: The duration of the animation in milliseconds.easing
: Can be a string reference to an easing function set on the Math object or a function.
Warning
Due to poor performance, animation is disabled in old IE browsers for several chart types.
- Return type:
AnimationOptions
orNone
- property animation_limit: int | float | Decimal | None
For some series, there is a limit that shuts down initial animation by default when the total number of points in the chart is too high. Defaults to
None
.For example, for a column chart and its derivatives, animation does not run if there is more than 250 points totally. To disable this cap, set
animation_limit
tofloat("inf")
(which represents infinity).- Return type:
numeric or
None
- property boost_threshold: int | None
Set the point threshold for when a series should enter boost mode. Defaults to
5000
.Setting it to e.g. 2000 will cause the series to enter boost mode when there are 2,000 or more points in the series.
To disable boosting on the series, set the
boost_threshold
to0
. Setting it to1
will force boosting.Note
The
AreaOptions.crop_threshold()
also affects this setting.When zooming in on a series that has fewer points than the
crop_threshold
, all points are rendered although outside the visible plot area, and theboost_threshold
won’t take effect.
- property border_color: str | Gradient | Pattern | None
The color of the border surrounding each slice. When
None
, the border takes the same color as the slice fill. This can be used together with aborder_width
to fill drawing gaps created by antialiazing artefacts in borderless pies. Defaults to'#ffffff'
.
- property border_radius: str | int | float | Decimal | None
New in version Highcharts: Core for Python v.1.1.0 / Highcharts Core (JS) v.11.0.0
The corner radius of the border surrounding each slice. Defaults to
3
.Note
A numerical value signifies the value is expressed in pixels. A percentage string like 50% signifies a size relative to the radius and the inner radius.
- property border_width: int | float | Decimal | None
The width of the border surrounding each slice. Defaults to
1
.When setting the border width to
0
, there may be small gaps between the slices due to SVG antialiasing artefacts. To work around this, keep the border width at0.5
or1
, but set theborder_color
toNone
instead.- Return type:
numeric or
None
- property center: List[str | int | float | Decimal | EnforcedNullType] | None
The center of the pie chart relative to the plot area.
Can be percentages or pixel values. The default behaviour if
None
is to center the pie so that all slices and data labels are within the plot area. As a consequence, the pie may actually jump around in a chart with dynamic values, as the data labels move. In that case, the center should be explicitly set, for example to["50%", "50%"]
.Defaults to
['50%', '50%']
.
- property class_name: str | None
The additional CSS class name to apply to the series’ graphical elements.
Note
This option is additive to the default class names - it does not replace them.
- property clip: bool | None
If
False
, allows the series to be rendered in the entire plot area. IfTrue
, constrains where the series can be rendered within the plot area. Defaults toTrue
.
- property color: str | Gradient | Pattern | None
The main color of the series.
In line type series it applies to the line and the point markers unless otherwise specified. In bar type series it applies to the bars unless a color is specified per point. The default value is pulled from the
Options.colors()
array.
- property color_axis: str | int | bool | None
When using dual or multiple color axes, this setting defines which color axis the particular series is connected to. It refers to either the
ColorAxis.id()
or the index of the axis in theColorAxis
array, with0
being the first. Set this option toFalse
to prevent a series from connecting to the default color axis.Defaults to
0
.
- property color_index: int | None
When operating in styled mode, a specific color index to use for the series, so that its graphic representations are given the class name
highcharts-color-{n}
.Tip
New in version Highcharts: (JS) v.11
With Highcharts (JS) v.11, using CSS variables of the form
--highcharts-color-{n}
make changing the color scheme very simple.Defaults to
None
.
- property color_key: str | None
Determines what data value should be used to calculate point color if
AreaOptions.color_axis()
is used.Note
Requires to set
min
andmax
if some custom point property is used or if approximation for data grouping is set to'sum'
.
- property colors: List[str | Gradient | Pattern] | None
A series-specific or series type-specific color set to apply instead of the global colors when
ArcDiagramOptions.color_by_point()
isTrue
.
- property connect_ends: bool | None
If
True
, connect the ends of a line series plot across the extremes. Defaults toNone
.Warning
Applies to polar charts only.
- property connect_nulls: bool | None
If
True
, connect a graph line across null points. IfFalse
, renders a gap between the points on either side of the null point. Defaults toFalse
.
- property crisp: bool | None
If
True
, each point or column edge is rounded to its nearest pixel in order to render sharp on screen. Defaults toTrue
.Hint
In some cases, when there are a lot of densely packed columns, this leads to visible difference in column widths or distance between columns. In these cases, setting
crisp
toFalse
may look better, even though each column is rendered blurry.
- property crop_threshold: int | None
When the series contains less points than the crop threshold, all points are drawn, even if the points fall outside the visible plot area at the current zoom. Defaults to
300
.The advantage of drawing all points (including markers and columns), is that animation is performed on updates. On the other hand, when the series contains more points than the crop threshold, the series data is cropped to only contain points that fall within the plot area. The advantage of cropping away invisible points is to increase performance on large series.
- property cursor: str | None
The style of cursor to use when the user’s mouse hovers over the data series.
Acceptable values are:
'alias'
'all-scroll'
'auto'
'cell'
'col-resize'
'context-menu'
'copy'
'crosshair'
'default'
'e-resize'
'ew-resize'
'grab'
'grabbing'
'help'
'move'
'n-resize'
'ne-resize'
'nesw-resize'
'no-drop'
'none'
'not-allowed'
'ns-resize'
'nw-resize'
'nwse-resize'
'pointer'
'progress'
'row-resize'
's-resize'
'se-resize'
'sw-resize'
'text'
'vertical-text'
'w-resize'
'wait'
'zoom-in'
'zoom-out'
- property custom: JavaScriptDict | None
A reserved subspace to store options and values for customized functionality.
Here you can add additional data for your own event callbacks and formatter callbacks.
- property dash_style: str | None
Name of the dash style to use for the graph, or for some series types the outline of each shape.
Accepts one of the following values:
‘Dash’,
‘DashDot’,
‘Dot’,
‘LongDash’,
‘LongDashDot’,
‘LongDashDotDot’,
‘ShortDash’,
‘ShortDashDot’,
‘ShortDashDotDot’,
‘ShortDot’,
‘Solid’
- property data: List[PieData] | None
Collection of data that represents the series. Defaults to
None
.While the series type returns a collection of
PieData
instances, it accepts as input three different types of data:series = PieSeries() series.data = [0, 5, 3, 5]
A one-dimensional collection of numerical values. Each member of the collection will be interpreted as a
y
valueA one-dimensional collection of
PieData
objects.
- property data_as_columns: bool | None
If
True
, indicates that the data is structured as columns instead of as rows. Defaults toNone
, which behaves asFalse
.
- property data_labels: DataLabel | List[DataLabel] | None
Options for the series data labels, appearing next to each data point.
Note
To have multiple data labels per data point, you can also supply a collection of
DataLabel
configuration settings.
- property data_sorting: DataSorting | None
Options for the series data sorting.
- Return type:
DataSorting
orNone
- property depth: int | float | Decimal | None
The thickness of a 3D pie. Defaults to
0
.- Return type:
numeric or
None
- property description: str | None
A description of the series to add to the screen reader information about the series.
- property drag_drop: DragDropOptions | None
The draggable-points module allows points to be moved around or modified in the chart.
In addition to the options mentioned under the dragDrop API structure, the module fires three (JavaScript) events:
point.dragStart
point.drag
point.drop
- Return type:
DragDropOptions
orNone
- property enable_mouse_tracking: bool | None
If
True
, enables mouse tracking for the series (used to capture point tooltips, click events on graphs and points, etc.). IfFalse
, disables mouse tracking for the series (which can help performance). Defaults toTrue
.
- property end_angle: int | float | Decimal | None
The end angle of the pie in degrees where 0 is top and 90 is right. Defaults to
None
, which is equivalent tostart_angle
plus360
.- Return type:
numeric or
None
- property events: SeriesEvents | None
General event handlers for the series items.
Note
These event hooks can also be attached to the series at run time using the (JavaScript)
Highcharts.addEvent()
function.- Return type:
SeriesEvents
orNone
- property fill_color: str | Gradient | Pattern | None
If the total sum of the pie’s values is
0
, the series is represented as an empty circle . Thefill_color
setting defines the color of that circle. UsePieOptions.border_width()
to set the border thickness.Defaults to
None
.- Return type:
None
,Gradient
, orPattern
- property find_nearest_point_by: str | None
Determines whether the series should look for the nearest point in both dimensions or just the x-dimension when hovering the series.
If
None
, defaults to'xy'
for scatter series and'x'
for most other series. If the data has duplicate x-values, it is recommended to set this to'xy'
to allow hovering over all points.Applies only to series types using nearest neighbor search (not direct hover) for tooltip.
- property get_extremes_from_all: bool | None
If
True
, uses the Y extremes of the total chart width or only the zoomed area when zooming in on parts of the X axis. By default, the Y axis adjusts to the min and max of the visible data.Warning
Applies to Cartesian series only.
- property id: str | None
An id for the series. Defaults to
None
.Hint
This can be used (in JavaScript) after render time to get a pointer to the series object through
chart.get()
.
If
True
, the series shall be redrawn as if the hidden points werenull
. IfFalse
, hidden points will not be displayed but the slice will still be drawn as a gap in the pie.Defaults to
True
.
- property include_in_data_export: bool | None
If
False
, will prevent the data series from being included in any form of data export. Defaults toTrue
.
- property index: int | None
The index for the series in the chart, affecting the internal index in the (JavaScript)
chart.series
array, the visible Z-index, and the order of the series in the legend. Defaults toNone
.
- property inner_size: str | int | None
The size of the inner diameter for the pie, expressed as a percentage or pixel value. Defaults to
0
.Hint
A size greater than 0 renders a donut chart.
Note
Percentages are relative to the pie size. Pixel values are given as integers.
Warning
If
PieOptions.thickness()
is set, this value will be overridden by thethickness
setting.
- property is_async: bool
Read-only property, where
True
indicates that the map data is loaded asynchronously andFalse
indicates that it is not.- Return type:
- property is_map_data_independent: bool
Read-only property, where
True
indicates that the map data is referencing a JavaScript variable defined outside of Highcharts Maps for Python.- Return type:
- property join_by: str | List[str] | EnforcedNullType | None
The property which should be used to join the series’
.map_data
to its.data
. WhenNone
, defaults to'hc-key'
.Accepts three possible types of value:
a string, which joins on the same property in both the
.mapData
and.data
Note
For maps loaded from GeoJSON, the keys may be held in each point’s
properties
object.a 2-member collection, where the first represents the key in
.mapData
and the second represents a (different) key in.data
highcharts_maps.constants.EnforcedNull
, where items are joined by their positions in the.mapData
and.data
arrays
Tip
Using
highcharts_maps.constants.EnforcedNull
performs much faster than the other two options. This is the recommended value when rendering more than a thousand data points, assuming that you are using a backend that can preprocess the data into parallel arrays.- Return type:
highcharts_maps.constants.EnforcedNull
orstr
or 2-memberlist
ofstr
, orNone
- Raises:
HighchartsValueError – if supplied an iterable that has more than 2 members
- property keys: List[str] | None
An array specifying which option maps to which key in the data point array.
This makes it convenient to work with unstructured data arrays from different sources.
- property label: SeriesLabel | None
Series labels are placed as close to the series as possible in a natural way, seeking to avoid other series. The goal of this feature is to make the chart more easily readable, like if a human designer placed the labels in the optimal position.
Note
The series labels currently work with series types having a graph or an area.
- Return type:
SeriesLabel
orNone
- property legend_index: int | None
The sequential index for the series in the legend. Defaults to
None
.
- property line_width: int | float | Decimal | None
Pixel width of the graph line. Defaults to
2
.- Return type:
numeric or
None
- property linecap: str | None
The SVG value used for the
stroke-linecap
andstroke-linejoin
of a line graph. Defaults to'round'
, which means that lines are rounded in the ends and bends.
- property linked_to: str | None
The id of another series to link to.
Hint
The value can be
':previous'
to link to the previous series. When two series are linked, only the first one appears in the legend. Toggling the visibility of this also toggles the linked series.Note
If the master series uses data sorting and linked series does not have its own sorting definition, the linked series will be sorted in the same order as the master one.
- property map_data: MapData | AsyncMapData | VariableName | List[MapData | AsyncMapData] | None
Map geometries that provide instructions on how to render the map itself, along with relevant properties used to join each map area to its corresponding values in the
.data
.Accepts (either in object representation or as coercable objects):
GeoJSONBase
or descendanta
str
URL, which will be coerced toAsyncMapData
- Return type:
MapData
orAsyncMapData
orNone
- property marker: Marker | None
Options for the point markers of line-like series.
Properties like
fill_color
,line_color
andline_width
define the visual appearance of the markers. Other series types, like column series, don’t have markers, but have visual options on the series level instead.- Return type:
Marker
orNone
- property min_size: str | int | float | Decimal | None
The minimum size for a pie in response to auto margins, expressed in pixels or percentages. Defaults to
80
.Note
The pie will try to shrink to make room for data labels in side the plot area, but only to this size.
- property name: str | None
The name of the series as shown in the legend, tooltip, etc. Defaults to
None
.
- property negative_color: str | Gradient | Pattern | None
The color for the parts of the graph or points that are below the
AreaOptions.threshold()
.Note
Zones
take precedence over the negative color. Usingnegative_color
is equivalent to applying a zone with value of 0.
- property on_point: OnPointOptions | None
Options for the Series on point feature, which is currently only supported by
pie
andsunburst
chargs.- Return type:
OnPointOptions
orNone
- property opacity: float | None
Opacity of a series parts: line, fill (e.g. area), and labels.
- Return type:
- property point_description_formatter: CallbackFunction | None
Same as for
Accessibility.series.description_formatter()
, only for an individual series. Overrides the chart-wide configuration.- Return type:
CallbackFunction
orNone
- property point_interval: int | float | Decimal | None
If no x values are given for the points in a series,
point_interval
defines the interval of the x values. Defaults to1
.For example, if a series contains one value every decade starting from year 0, set
point_interval
to10
. In true datetime axes, thepoint_interval
is set in milliseconds.Hint
point_interval
can be also be combined withpoint_interval_unit
to draw irregular time intervals.Note
If combined with
relative_x_value
, an x value can be set on each point, and thepoint_interval
is added x times to thepoint_start
setting.Warning
This options applies to the series data, not the interval of the axis ticks, which is independent.
- Return type:
numeric or
None
- property point_interval_unit: str | None
On datetime series, this allows for setting the
point_interval
to irregular time units, day, month, and year.A day is usually the same as 24 hours, but
point_interval_unit
also takes the DST crossover into consideration when dealing with local time.Combine this option with
point_interval
to draw weeks, quarters, 6 month periods, 10 year periods, etc.Warning
This options applies to the series data, not the interval of the axis ticks, which is independent.
- property point_placement: str | int | float | Decimal | None
Used to determine the placement of the point in relation to tick marks on the X axis. Defaults to
None
, which behaves as undefined in cartesian charts, and"between"
in polar charts.Accepts possible values:
'on'
- where the point will not create any padding of the X axis. In a polar column chart this means that the first column points directly north."between"
- where the columns will be laid out between ticks. This is useful for example for visualising an amount between two points in time or in a certain sector of a polar chart.a numeric value - where
0
is on the axis value,-0.5
is between this value and the previous, and0.5
is between this value and the next. Unlike the textual options, numeric point placement options won’t affect axis padding.
Warning
Requires
point_range
to work. For column series this is computed, but for line-type series it needs to be set.Note
For the xrange series type and gantt charts, if the Y axis is a category axis, the
point_placement
applies to the Y axis rather than the (typically datetime) X axis.
- property point_start: int | float | Decimal | None
If no x values are given for the points in a series,
point_start
defines on what value to start. For example, if a series contains one yearly value starting from 1945, setpoint_start
to1945
. Defaults to0
.Note
If combined with
relative_x_value
, an x value can be set on each point. The x value from the point options is multiplied bypoint_interval
and added topoint_start
to produce a modified x value.- Return type:
numeric or
None
- property relative_x_value: bool | None
When
True
, X values in the data set are relative to the currentpoint_start
,point_interval
, andpoint_interval_unit
settings. This allows compression of the data for datasets with irregular X values. Defaults toFalse
.The real X values are computed on the formula
f(x) = ax + b
, wherea
is thepoint_interval
(optionally with a time unit given bypoint_interval_unit
), andb
is thepoint_start
.
- property selected: bool | None
If
True
, the series is selected initially (by default, without user interaction). Defaults toFalse
.Note
If
GenericTypeOptions.show_checkbox()
isTrue
, then the checkbox will be checked ifselected
isTrue
.
- property shadow: bool | ShadowOptions | None
Configuration for the shadow to apply to the tooltip. Defaults to
False
.If
False
, no shadow is applied.- Returns:
The shadow configuration to apply or a boolean setting which hides the shadow or displays the default shadow.
- Return type:
bool
orShadowOptions
- property show_checkbox: bool | None
If
True
, a checkbox is displayed next to the legend item to allow selecting the series.Note
The state of the checkbox is controlled by the
GenericTypeOptions.selected()
property.
- property show_in_legend: bool | None
Whether to display this particular series or series type in the legend. Standalone series are shown in the legend by default, and linked series are not.
- property size: str | int | None
The diameter of the pie relative to the plot area, expressed as a percentage or pixel value given as an integer.
If
None
, scales the pie to the plot area and gives room for data labels within the plot area.Note
PieOptions.sliced_offset()
is also included in the default size calculation. As a consequence, the size of the pie may vary when points are updated and data labels more around. In that case it is best to set a fixed value, for example"75%"
.
If
True
, the accessibility module will skip past this series when executing keyboard navigation.
- property sliced_offset: int | float | Decimal | None
If a point is sliced, moved out from the center, how many pixels should it be moved? Defaults to
10
.- Return type:
numeric or
None
- property soft_threshold: bool | None
When
True
, the series will not cause the Y axis to cross the zero plane (or threshold option) unless the data actually crosses the plane. Defaults toTrue
.For example, if
False
, a series of0, 1, 2, 3
will make the Y axis show negative values according to themin_padidng
option. IfTrue
, the Y axis starts at 0.- Return type:
- property sonification: SeriesSonification | None
Sonification configuration for the series type/series.
- Return type:
- property stack: str | None
Indicates the “stack” into which the series should be grouped, if the chart groups series into stacks. Defaults to
None
.Note
The value can be a string or a numeric value, provided that series in the same stack all have the same value when converted to a string. For ease of ues, Highcharts for Python will attempt to force the conversion of the relevant value to a string.
- property stacking: str | None
Whether to stack the values of each series on top of each other. Defaults to
None
.Acceptable values are:
None
to disable stacking,"normal"
to stack by value or"percent"
'stream'
(for streamgraph series type only)'overlap'
(for waterfall series type only)
Note
When stacking is enabled, data must be sorted in ascending X order.
- property start_angle: int | float | Decimal | None
The start angle of the dependency wheel, in degrees where
0
is up. Defaults to0
.- Return type:
numeric or
None
- property states: States | None
Configuration for state-specific configuration to apply to the data series.
- Return type:
States
orNone
- property step: str | None
Whether to apply steps to the line. Defaults to
None
.Possible values are:
'left'
'center'
'right'
- property sticky_tracking: bool | None
Sticky tracking of mouse events.
When
True
, the (JavaScript)mouseOut
event on a series is not triggered until the mouse moves over another series, or out of the plot area.When
False
, the (JavaScript)mouseOut
event on a series is triggered when the mouse leaves the area around the series’ graph or markers. This also implies the tooltip when not shared.When
False
andPlotOptions.tooltip.shared()
is alsoFalse
, the tooltip will be hidden when moving the mouse between series.Defaults to
True
for line and area type series, but toFalse
for columns, pies, etc.Note
The boost module will force this option because of technical limitations.
- property thickness: int | None
Thickness describing the ring size for a donut type chart, overriding
PieOptions.inner_size()
. Defaults toNone
.
- property threshold: int | float | Decimal | EnforcedNullType | None
The Y axis value to serve as the base for the columns, for distinguishing between values above and below a threshold. Defaults to
0
.If
EnforcedNullType
, the columns extend from the padding Y axis minimum.- Return type:
numeric or
EnforcedNullType
orNone
- property tooltip: Tooltip | None
A configuration object for the tooltip rendering of each single series. Properties are inherited from tooltip, but only the following properties can be defined on a series level.
- Return type:
Tooltip
orNone
- property turbo_threshold: int | None
When a series contains a data array longer than this value, only one dimensional arrays of numbers, or two dimensional arrays with x and y values are allowed. Also, only the first point is tested, and the rest are assumed to be the same format. This saves expensive data checking and indexing in long series. Set it to
0
orNone
to disable.Defaults to
1000
.Note
In boost mode, turbo threshold is forced. Only array of numbers or two dimensional arrays are allowed.
- property type: str
Indicates the type of series that is represented by this instance.
Warning
This proprety is read-only!
- Return type:
- property visible: bool | None
If
True
, the series is initially visible. IfFalse
, the series is hidden by default. Defaults toTrue
.
- property x_axis: str | int | None
When using multiple X-axes, this setting determines on which axis the series should be drawn. Its value should be either a numerical index position in the
Options.x_axis()
array (starting at 0), or astr
indicating theid
of the axis to which the series should be connected. Defaults toNone
, which behaves as if the value were set to0
.
- property y_axis: str | int | None
When using multiple Y-axes, this setting determines on which axis the series should be drawn. Its value should be either a numerical index position in the
Options.y_axis()
array (starting at 0), or astr
indicating theid
of the axis to which the series should be connected. Defaults toNone
, which behaves as if the value were set to0
.
- property z_index: int | float | Decimal | None
The visual z-index of the series. Defaults to
None
.- Return type:
numeric or
None
class: VariablePieSeries
- class VariablePieSeries(**kwargs)[source]
Options to apply to a Variable Pie series.
A variable pie series is a two dimensional series type, where each point renders an Y and Z value. Each point is drawn as a pie slice where the size (arc) of the slice relates to the Y value and the radius of pie slice relates to the Z value.
Class Inheritance
- copy(other=None, overwrite=True, **kwargs)
Copy the configuration settings from this instance to the
other
instance.- Parameters:
other (
HighchartsMeta
) – The target instance to which the properties of this instance should be copied. IfNone
, will create a new instance and populate it with properties copied fromself
. Defaults toNone
.overwrite (
bool
) – ifTrue
, properties inother
that are already set will be overwritten by their counterparts inself
. Defaults toTrue
.kwargs – Additional keyword arguments. Some special descendents of
HighchartsMeta
may have special implementations of this method which rely on additional keyword arguments.
- Returns:
A mutated version of
other
with new property values
- classmethod from_csv(as_string_or_file, property_column_map, has_header_row=True, series_kwargs=None, delimiter=',', null_text='None', wrapper_character="'", line_terminator='\r\n', wrap_all_strings=False, double_wrapper_character_when_nested=False, escape_character='\\')
Create a new series instance with a
.data
property populated from data in a CSV string or file.Note
For an example
LineSeries
, the minimum code required would be:my_series = LineSeries.from_csv('some-csv-file.csv', property_column_map = { 'x': 0, 'y': 3, 'id': 'id' })
As the example above shows, data is loaded into the
my_series
instance from the CSV file with a filenamesome-csv-file.csv
. Thex
values for each data point will be taken from the first (index 0) column in the CSV file. They
values will be taken from the fourth (index 3) column in the CSV file. And theid
values will be taken from a column whose header row is labeled'id'
(regardless of its index).- Parameters:
as_string_or_file (
str
or Path-like) –The CSV data to use to pouplate data. Accepts either the raw CSV data as a
str
or a path to a file in the runtime environment that contains the CSV data.Tip
Unwrapped empty column values are automatically interpreted as null (
None
).property_column_map (
dict
) –A
dict
used to indicate which data point property should be set to which CSV column. The keys in thedict
should correspond to properties in the data point class, while the value can either be a numerical index (starting with 0) or astr
indicating the label for the CSV column.has_header_row (
bool
) – IfTrue
, indicates that the first row ofas_string_or_file
contains column labels, rather than actual data. Defaults toTrue
.series_kwargs (
dict
) –An optional
dict
containing keyword arguments that should be used when instantiating the series instance. Defaults toNone
.Warning
If
series_kwargs
contains adata
key, its value will be overwritten. Thedata
value will be created from the CSV file instead.delimiter (
str
) – The delimiter used between columns. Defaults to,
.wrapper_character (
str
) – The string used to wrap string values when wrapping is applied. Defaults to'
.null_text (
str
) – The string used to indicate an empty value if empty values are wrapped. Defaults to None.line_terminator (
str
) – The string used to indicate the end of a line/record in the CSV data. Defaults to'\r\n'
.line_terminator –
The string used to indicate the end of a line/record in the CSV data. Defaults to
'\r\n'
.Note
The Python
csv
currently ignores theline_terminator
parameter and always applies'\r\n'
, by design. The Python docs say this may change in the future, so for future backwards compatibility we are including it here.wrap_all_strings (
bool
) –If
True
, indicates that the CSV file has all string data values wrapped in quotation marks. Defaults toFalse
.double_wrapper_character_when_nested (
bool
) – IfTrue
, quote character is doubled when appearing within a string value. IfFalse
, theescape_character
is used to prefix quotation marks. Defaults toFalse
.escape_character (
str
) – A one-character string that indicates the character used to escape quotation marks if they appear within a string value that is already wrapped in quotation marks. Defaults to\\
(which is Python for'\'
, which is Python’s native escape character).
- Returns:
A series instance (descended from
SeriesBase
) with its.data
property populated from the CSV data inas_string_or_file
.- Return type:
list
of series instances (descended fromSeriesBase
)- Raises:
HighchartsCSVDeserializationError – if
property_column_map
references CSV columns by their label, but the CSV data does not contain a header row
- classmethod from_dict(as_dict: dict, allow_snake_case: bool = True)
Construct an instance of the class from a
dict
object.
- classmethod from_js_literal(as_str_or_file, allow_snake_case: bool = True, _break_loop_on_failure: bool = False)
Return a Python object representation of a Highcharts JavaScript object literal.
- Parameters:
as_str_or_file (
str
) – The JavaScript object literal, represented either as astr
or as a filename which contains the JS object literal.allow_snake_case (
bool
) – IfTrue
, interpretssnake_case
keys as equivalent tocamelCase
keys. Defaults toTrue
._break_loop_on_failure (
bool
) – IfTrue
, will break any looping operations in the event of a failure. Otherwise, will attempt to repair the failure. Defaults toFalse
.
- Returns:
A Python object representation of the Highcharts JavaScript object literal.
- Return type:
HighchartsMeta
- classmethod from_json(as_json_or_file, allow_snake_case: bool = True)
Construct an instance of the class from a JSON string.
- Parameters:
as_json_or_file – The JSON string for the object or the filename of a file that contains the JSON string.
allow_snake_case (
bool
) – IfTrue
, interpretssnake_case
keys as equivalent tocamelCase
keys. Defaults toTrue
.
- Returns:
A Python objcet representation of
as_json
.- Return type:
HighchartsMeta
- classmethod from_pandas(df, property_map, series_kwargs=None)
Create a series instance whose
.data
property is populated from a pandasDataFrame
.- Parameters:
df (
DataFrame
) – TheDataFrame
from which data should be loaded.property_map (
dict
) – Adict
used to indicate which data point property should be set to which column indf
. The keys in thedict
should correspond to properties in the data point class, while the value should indicate the label for theDataFrame
column.series_kwargs (
dict
) –An optional
dict
containing keyword arguments that should be used when instantiating the series instance. Defaults toNone
.Warning
If
series_kwargs
contains adata
key, its value will be overwritten. Thedata
value will be created fromdf
instead.
- Returns:
A series instance (descended from
SeriesBase
) with its.data
property populated from the data indf
.- Return type:
list
of series instances (descended fromSeriesBase
)- Raises:
HighchartsPandasDeserializationError – if
property_map
references a column that does not exist in the data frameif pandas is not available in the runtime environment
- classmethod from_pyspark(df, property_map, series_kwargs=None)
Create a series instance whose
.data
property is populated from a PySparkDataFrame
.- Parameters:
df (
DataFrame
) – TheDataFrame
from which data should be loaded.property_map (
dict
) – Adict
used to indicate which data point property should be set to which column indf
. The keys in thedict
should correspond to properties in the data point class, while the value should indicate the label for theDataFrame
column.series_kwargs (
dict
) –An optional
dict
containing keyword arguments that should be used when instantiating the series instance. Defaults toNone
.Warning
If
series_kwargs
contains adata
key, its value will be overwritten. Thedata
value will be created fromdf
instead.
- Returns:
A series instance (descended from
SeriesBase
) with its.data
property populated from the data indf
.- Return type:
list
of series instances (descended fromSeriesBase
)- Raises:
HighchartsPySparkDeserializationError – if
property_map
references a column that does not exist in the data frameif PySpark is not available in the runtime environment
- load_from_csv(as_string_or_file, property_column_map, has_header_row=True, delimiter=',', null_text='None', wrapper_character="'", line_terminator='\r\n', wrap_all_strings=False, double_wrapper_character_when_nested=False, escape_character='\\')
Replace the existing
.data
property with a new value populated from data in a CSV string or file.Note
For an example
LineSeries
, the minimum code required would be:my_series = LineSeries() my_series = my_series.from_csv('some-csv-file.csv', property_column_map = { 'x': 0, 'y': 3, 'id': 'id' })
As the example above shows, data is loaded into the
my_series
instance from the CSV file with a filenamesome-csv-file.csv
. Thex
values for each data point will be taken from the first (index 0) column in the CSV file. They
values will be taken from the fourth (index 3) column in the CSV file. And theid
values will be taken from a column whose header row is labeled'id'
(regardless of its index).- Parameters:
as_string_or_file (
str
or Path-like) –The CSV data to use to pouplate data. Accepts either the raw CSV data as a
str
or a path to a file in the runtime environment that contains the CSV data.Tip
Unwrapped empty column values are automatically interpreted as null (
None
).property_column_map (
dict
) –A
dict
used to indicate which data point property should be set to which CSV column. The keys in thedict
should correspond to properties in the data point class, while the value can either be a numerical index (starting with 0) or astr
indicating the label for the CSV column.has_header_row (
bool
) – IfTrue
, indicates that the first row ofas_string_or_file
contains column labels, rather than actual data. Defaults toTrue
.delimiter (
str
) – The delimiter used between columns. Defaults to,
.wrapper_character (
str
) – The string used to wrap string values when wrapping is applied. Defaults to'
.null_text (
str
) – The string used to indicate an empty value if empty values are wrapped. Defaults to None.line_terminator (
str
) – The string used to indicate the end of a line/record in the CSV data. Defaults to'\r\n'
.line_terminator –
The string used to indicate the end of a line/record in the CSV data. Defaults to
'\r\n'
.Note
The Python
csv
currently ignores theline_terminator
parameter and always applies'\r\n'
, by design. The Python docs say this may change in the future, so for future backwards compatibility we are including it here.wrap_all_strings (
bool
) –If
True
, indicates that the CSV file has all string data values wrapped in quotation marks. Defaults toFalse
.double_wrapper_character_when_nested (
bool
) – IfTrue
, quote character is doubled when appearing within a string value. IfFalse
, theescape_character
is used to prefix quotation marks. Defaults toFalse
.escape_character (
str
) – A one-character string that indicates the character used to escape quotation marks if they appear within a string value that is already wrapped in quotation marks. Defaults to\
(which is Python for''
, which is Python’s native escape character).
- Raises:
HighchartsCSVDeserializationError – if
property_column_map
references CSV columns by their label, but the CSV data does not contain a header row
- load_from_pandas(df, property_map)
Replace the contents of the
.data
property with data points populated from a pandasDataFrame
.- Parameters:
df (
DataFrame
) – TheDataFrame
from which data should be loaded.property_map (
dict
) – Adict
used to indicate which data point property should be set to which column indf
. The keys in thedict
should correspond to properties in the data point class, while the value should indicate the label for theDataFrame
column.
- Raises:
HighchartsPandasDeserializationError – if
property_map
references a column that does not exist in the data frameif pandas is not available in the runtime environment
- load_from_pyspark(df, property_map)
Replaces the contents of the
.data
property with values from a PySparkDataFrame
.- Parameters:
df (
DataFrame
) – TheDataFrame
from which data should be loaded.property_map (
dict
) – Adict
used to indicate which data point property should be set to which column indf
. The keys in thedict
should correspond to properties in the data point class, while the value should indicate the label for theDataFrame
column.
- Raises:
HighchartsPySparkDeserializationError – if
property_map
references a column that does not exist in the data frameif PySpark is not available in the runtime environment
- to_dict() dict
Generate a
dict
representation of the object compatible with the Highcharts JavaScript library.Note
The
dict
representation has a property structure and naming convention that is intentionally consistent with the Highcharts JavaScript library. This is not Pythonic, but it makes managing the interplay between the two languages much, much simpler.
- to_js_literal(filename=None, encoding='utf-8') str | None
Return the object represented as a
str
containing the JavaScript object literal.
- to_json(filename=None, encoding='utf-8')
Generate a JSON string/byte string representation of the object compatible with the Highcharts JavaScript library.
Note
This method will either return a standard
str
or abytes
object depending on the JSON serialization library you are using. For example, if your environment has orjson, the result will be abytes
representation of the string.- Parameters:
- Returns:
A JSON representation of the object compatible with the Highcharts library.
- Return type:
- static trim_dict(untrimmed: dict, to_json: bool = False) dict
Remove keys from
untrimmed
whose values areNone
and convert values that have.to_dict()
methods.
- static trim_iterable(untrimmed, to_json=False)
Convert any
EnforcedNullType
values inuntrimmed
to'null'
.
- property accessibility: TypeOptionsAccessibility | None
Accessibility options for a series.
- Return type:
TypeOptionsAccessibility
orNone
- property allow_point_select: bool | None
Allow this series’ points to be selected by clicking on the graphic (columns, point markers, pie slices, map areas etc).
The selected points can be handled in JavaScript by point select and unselect events, or collectively by the (JavaScript)
getSelectedPoints()
function.And alternative way of selecting points is through dragging.
Defaults to
False
.
- property animation: AnimationOptions | None
Enable or disable the initial animation when a series is displayed.
The animation can also be set as a configuration object. Please note that this option only applies to the initial animation of the series itself. For other animations, see
Chart.animation
and theanimation
parameter under the (JavaScript) API methods. The following properties are supported:defer
: The animation delay time in milliseconds.duration
: The duration of the animation in milliseconds.easing
: Can be a string reference to an easing function set on the Math object or a function.
Warning
Due to poor performance, animation is disabled in old IE browsers for several chart types.
- Return type:
AnimationOptions
orNone
- property animation_limit: int | float | Decimal | None
For some series, there is a limit that shuts down initial animation by default when the total number of points in the chart is too high. Defaults to
None
.For example, for a column chart and its derivatives, animation does not run if there is more than 250 points totally. To disable this cap, set
animation_limit
tofloat("inf")
(which represents infinity).- Return type:
numeric or
None
- property boost_threshold: int | None
Set the point threshold for when a series should enter boost mode. Defaults to
5000
.Setting it to e.g. 2000 will cause the series to enter boost mode when there are 2,000 or more points in the series.
To disable boosting on the series, set the
boost_threshold
to0
. Setting it to1
will force boosting.Note
The
AreaOptions.crop_threshold()
also affects this setting.When zooming in on a series that has fewer points than the
crop_threshold
, all points are rendered although outside the visible plot area, and theboost_threshold
won’t take effect.
- property border_color: str | Gradient | Pattern | None
The color of the border surrounding each slice. When
None
, the border takes the same color as the slice fill. This can be used together with aborder_width
to fill drawing gaps created by antialiazing artefacts in borderless pies. Defaults to'#ffffff'
.
- property border_radius: str | int | float | Decimal | None
New in version Highcharts: Core for Python v.1.1.0 / Highcharts Core (JS) v.11.0.0
The corner radius of the border surrounding each slice. Defaults to
3
.Note
A numerical value signifies the value is expressed in pixels. A percentage string like 50% signifies a size relative to the radius and the inner radius.
- property border_width: int | float | Decimal | None
The width of the border surrounding each slice. Defaults to
1
.When setting the border width to
0
, there may be small gaps between the slices due to SVG antialiasing artefacts. To work around this, keep the border width at0.5
or1
, but set theborder_color
toNone
instead.- Return type:
numeric or
None
- property center: List[str | int | float | Decimal | EnforcedNullType] | None
The center of the pie chart relative to the plot area.
Can be percentages or pixel values. The default behaviour if
None
is to center the pie so that all slices and data labels are within the plot area. As a consequence, the pie may actually jump around in a chart with dynamic values, as the data labels move. In that case, the center should be explicitly set, for example to["50%", "50%"]
.Defaults to
['50%', '50%']
.
- property class_name: str | None
The additional CSS class name to apply to the series’ graphical elements.
Note
This option is additive to the default class names - it does not replace them.
- property clip: bool | None
If
False
, allows the series to be rendered in the entire plot area. IfTrue
, constrains where the series can be rendered within the plot area. Defaults toTrue
.
- property color: str | Gradient | Pattern | None
The main color of the series.
In line type series it applies to the line and the point markers unless otherwise specified. In bar type series it applies to the bars unless a color is specified per point. The default value is pulled from the
Options.colors()
array.
- property color_axis: str | int | bool | None
When using dual or multiple color axes, this setting defines which color axis the particular series is connected to. It refers to either the
ColorAxis.id()
or the index of the axis in theColorAxis
array, with0
being the first. Set this option toFalse
to prevent a series from connecting to the default color axis.Defaults to
0
.
- property color_index: int | None
When operating in styled mode, a specific color index to use for the series, so that its graphic representations are given the class name
highcharts-color-{n}
.Tip
New in version Highcharts: (JS) v.11
With Highcharts (JS) v.11, using CSS variables of the form
--highcharts-color-{n}
make changing the color scheme very simple.Defaults to
None
.
- property color_key: str | None
Determines what data value should be used to calculate point color if
AreaOptions.color_axis()
is used.Note
Requires to set
min
andmax
if some custom point property is used or if approximation for data grouping is set to'sum'
.
- property colors: List[str | Gradient | Pattern] | None
A series-specific or series type-specific color set to apply instead of the global colors when
ArcDiagramOptions.color_by_point()
isTrue
.
- property connect_ends: bool | None
If
True
, connect the ends of a line series plot across the extremes. Defaults toNone
.Warning
Applies to polar charts only.
- property connect_nulls: bool | None
If
True
, connect a graph line across null points. IfFalse
, renders a gap between the points on either side of the null point. Defaults toFalse
.
- property crisp: bool | None
If
True
, each point or column edge is rounded to its nearest pixel in order to render sharp on screen. Defaults toTrue
.Hint
In some cases, when there are a lot of densely packed columns, this leads to visible difference in column widths or distance between columns. In these cases, setting
crisp
toFalse
may look better, even though each column is rendered blurry.
- property crop_threshold: int | None
When the series contains less points than the crop threshold, all points are drawn, even if the points fall outside the visible plot area at the current zoom. Defaults to
300
.The advantage of drawing all points (including markers and columns), is that animation is performed on updates. On the other hand, when the series contains more points than the crop threshold, the series data is cropped to only contain points that fall within the plot area. The advantage of cropping away invisible points is to increase performance on large series.
- property cursor: str | None
The style of cursor to use when the user’s mouse hovers over the data series.
Acceptable values are:
'alias'
'all-scroll'
'auto'
'cell'
'col-resize'
'context-menu'
'copy'
'crosshair'
'default'
'e-resize'
'ew-resize'
'grab'
'grabbing'
'help'
'move'
'n-resize'
'ne-resize'
'nesw-resize'
'no-drop'
'none'
'not-allowed'
'ns-resize'
'nw-resize'
'nwse-resize'
'pointer'
'progress'
'row-resize'
's-resize'
'se-resize'
'sw-resize'
'text'
'vertical-text'
'w-resize'
'wait'
'zoom-in'
'zoom-out'
- property custom: JavaScriptDict | None
A reserved subspace to store options and values for customized functionality.
Here you can add additional data for your own event callbacks and formatter callbacks.
- property dash_style: str | None
Name of the dash style to use for the graph, or for some series types the outline of each shape.
Accepts one of the following values:
‘Dash’,
‘DashDot’,
‘Dot’,
‘LongDash’,
‘LongDashDot’,
‘LongDashDotDot’,
‘ShortDash’,
‘ShortDashDot’,
‘ShortDashDotDot’,
‘ShortDot’,
‘Solid’
- property data: List[VariablePieData] | None
Collection of data that represents the series. Defaults to
None
.While the series type returns a collection of
VariablePieData
instances, it accepts as input three different types of data:series = VariablePieSeries() series.data = [ [40, 75], [50, 50], [60, 40] ]
A two-dimensional collection of numerical values. Each member of the collection will be interpreted as a
y
andz
respectively.A one-dimensional collection of
VariablePieData
objects.
- property data_labels: DataLabel | List[DataLabel] | None
Options for the series data labels, appearing next to each data point.
Note
To have multiple data labels per data point, you can also supply a collection of
DataLabel
configuration settings.
- property data_sorting: DataSorting | None
Options for the series data sorting.
- Return type:
DataSorting
orNone
- property depth: int | float | Decimal | None
The thickness of a 3D pie. Defaults to
0
.- Return type:
numeric or
None
- property description: str | None
A description of the series to add to the screen reader information about the series.
- property drag_drop: DragDropOptions | None
The draggable-points module allows points to be moved around or modified in the chart.
In addition to the options mentioned under the dragDrop API structure, the module fires three (JavaScript) events:
point.dragStart
point.drag
point.drop
- Return type:
DragDropOptions
orNone
- property enable_mouse_tracking: bool | None
If
True
, enables mouse tracking for the series (used to capture point tooltips, click events on graphs and points, etc.). IfFalse
, disables mouse tracking for the series (which can help performance). Defaults toTrue
.
- property end_angle: int | float | Decimal | None
The end angle of the pie in degrees where 0 is top and 90 is right. Defaults to
None
, which is equivalent tostart_angle
plus360
.- Return type:
numeric or
None
- property events: SeriesEvents | None
General event handlers for the series items.
Note
These event hooks can also be attached to the series at run time using the (JavaScript)
Highcharts.addEvent()
function.- Return type:
SeriesEvents
orNone
- property fill_color: str | Gradient | Pattern | None
If the total sum of the pie’s values is
0
, the series is represented as an empty circle . Thefill_color
setting defines the color of that circle. UsePieOptions.border_width()
to set the border thickness.Defaults to
None
.- Return type:
None
,Gradient
, orPattern
- property find_nearest_point_by: str | None
Determines whether the series should look for the nearest point in both dimensions or just the x-dimension when hovering the series.
If
None
, defaults to'xy'
for scatter series and'x'
for most other series. If the data has duplicate x-values, it is recommended to set this to'xy'
to allow hovering over all points.Applies only to series types using nearest neighbor search (not direct hover) for tooltip.
- property get_extremes_from_all: bool | None
If
True
, uses the Y extremes of the total chart width or only the zoomed area when zooming in on parts of the X axis. By default, the Y axis adjusts to the min and max of the visible data.Warning
Applies to Cartesian series only.
- property id: str | None
An id for the series. Defaults to
None
.Hint
This can be used (in JavaScript) after render time to get a pointer to the series object through
chart.get()
.
If
True
, the series shall be redrawn as if the hidden points werenull
. IfFalse
, hidden points will not be displayed but the slice will still be drawn as a gap in the pie.Defaults to
True
.
- property include_in_data_export: bool | None
If
False
, will prevent the data series from being included in any form of data export. Defaults toTrue
.
- property index: int | None
The index for the series in the chart, affecting the internal index in the (JavaScript)
chart.series
array, the visible Z-index, and the order of the series in the legend. Defaults toNone
.
- property inner_size: str | int | None
The size of the inner diameter for the pie, expressed as a percentage or pixel value. Defaults to
0
.Hint
A size greater than 0 renders a donut chart.
Note
Percentages are relative to the pie size. Pixel values are given as integers.
Warning
If
PieOptions.thickness()
is set, this value will be overridden by thethickness
setting.
- property keys: List[str] | None
An array specifying which option maps to which key in the data point array.
This makes it convenient to work with unstructured data arrays from different sources.
- property label: SeriesLabel | None
Series labels are placed as close to the series as possible in a natural way, seeking to avoid other series. The goal of this feature is to make the chart more easily readable, like if a human designer placed the labels in the optimal position.
Note
The series labels currently work with series types having a graph or an area.
- Return type:
SeriesLabel
orNone
- property legend_index: int | None
The sequential index for the series in the legend. Defaults to
None
.
- property line_width: int | float | Decimal | None
Pixel width of the graph line. Defaults to
2
.- Return type:
numeric or
None
- property linecap: str | None
The SVG value used for the
stroke-linecap
andstroke-linejoin
of a line graph. Defaults to'round'
, which means that lines are rounded in the ends and bends.
- property linked_to: str | None
The id of another series to link to.
Hint
The value can be
':previous'
to link to the previous series. When two series are linked, only the first one appears in the legend. Toggling the visibility of this also toggles the linked series.Note
If the master series uses data sorting and linked series does not have its own sorting definition, the linked series will be sorted in the same order as the master one.
- property marker: Marker | None
Options for the point markers of line-like series.
Properties like
fill_color
,line_color
andline_width
define the visual appearance of the markers. Other series types, like column series, don’t have markers, but have visual options on the series level instead.- Return type:
Marker
orNone
- property min_size: str | int | float | Decimal | None
The minimum size for a pie in response to auto margins, expressed in pixels or percentages. Defaults to
80
.Note
The pie will try to shrink to make room for data labels in side the plot area, but only to this size.
- property name: str | None
The name of the series as shown in the legend, tooltip, etc. Defaults to
None
.
- property negative_color: str | Gradient | Pattern | None
The color for the parts of the graph or points that are below the
AreaOptions.threshold()
.Note
Zones
take precedence over the negative color. Usingnegative_color
is equivalent to applying a zone with value of 0.
- property on_point: OnPointOptions | None
Options for the Series on point feature, which is currently only supported by
pie
andsunburst
chargs.- Return type:
OnPointOptions
orNone
- property opacity: float | None
Opacity of a series parts: line, fill (e.g. area), and labels.
- Return type:
- property point_description_formatter: CallbackFunction | None
Same as for
Accessibility.series.description_formatter()
, only for an individual series. Overrides the chart-wide configuration.- Return type:
CallbackFunction
orNone
- property point_interval: int | float | Decimal | None
If no x values are given for the points in a series,
point_interval
defines the interval of the x values. Defaults to1
.For example, if a series contains one value every decade starting from year 0, set
point_interval
to10
. In true datetime axes, thepoint_interval
is set in milliseconds.Hint
point_interval
can be also be combined withpoint_interval_unit
to draw irregular time intervals.Note
If combined with
relative_x_value
, an x value can be set on each point, and thepoint_interval
is added x times to thepoint_start
setting.Warning
This options applies to the series data, not the interval of the axis ticks, which is independent.
- Return type:
numeric or
None
- property point_interval_unit: str | None
On datetime series, this allows for setting the
point_interval
to irregular time units, day, month, and year.A day is usually the same as 24 hours, but
point_interval_unit
also takes the DST crossover into consideration when dealing with local time.Combine this option with
point_interval
to draw weeks, quarters, 6 month periods, 10 year periods, etc.Warning
This options applies to the series data, not the interval of the axis ticks, which is independent.
- property point_placement: str | int | float | Decimal | None
Used to determine the placement of the point in relation to tick marks on the X axis. Defaults to
None
, which behaves as undefined in cartesian charts, and"between"
in polar charts.Accepts possible values:
'on'
- where the point will not create any padding of the X axis. In a polar column chart this means that the first column points directly north."between"
- where the columns will be laid out between ticks. This is useful for example for visualising an amount between two points in time or in a certain sector of a polar chart.a numeric value - where
0
is on the axis value,-0.5
is between this value and the previous, and0.5
is between this value and the next. Unlike the textual options, numeric point placement options won’t affect axis padding.
Warning
Requires
point_range
to work. For column series this is computed, but for line-type series it needs to be set.Note
For the xrange series type and gantt charts, if the Y axis is a category axis, the
point_placement
applies to the Y axis rather than the (typically datetime) X axis.
- property point_start: int | float | Decimal | None
If no x values are given for the points in a series,
point_start
defines on what value to start. For example, if a series contains one yearly value starting from 1945, setpoint_start
to1945
. Defaults to0
.Note
If combined with
relative_x_value
, an x value can be set on each point. The x value from the point options is multiplied bypoint_interval
and added topoint_start
to produce a modified x value.- Return type:
numeric or
None
- property relative_x_value: bool | None
When
True
, X values in the data set are relative to the currentpoint_start
,point_interval
, andpoint_interval_unit
settings. This allows compression of the data for datasets with irregular X values. Defaults toFalse
.The real X values are computed on the formula
f(x) = ax + b
, wherea
is thepoint_interval
(optionally with a time unit given bypoint_interval_unit
), andb
is thepoint_start
.
- property selected: bool | None
If
True
, the series is selected initially (by default, without user interaction). Defaults toFalse
.Note
If
GenericTypeOptions.show_checkbox()
isTrue
, then the checkbox will be checked ifselected
isTrue
.
- property shadow: bool | ShadowOptions | None
Configuration for the shadow to apply to the tooltip. Defaults to
False
.If
False
, no shadow is applied.- Returns:
The shadow configuration to apply or a boolean setting which hides the shadow or displays the default shadow.
- Return type:
bool
orShadowOptions
- property show_checkbox: bool | None
If
True
, a checkbox is displayed next to the legend item to allow selecting the series.Note
The state of the checkbox is controlled by the
GenericTypeOptions.selected()
property.
- property show_in_legend: bool | None
Whether to display this particular series or series type in the legend. Standalone series are shown in the legend by default, and linked series are not.
- property size: str | int | None
The diameter of the pie relative to the plot area, expressed as a percentage or pixel value given as an integer.
If
None
, scales the pie to the plot area and gives room for data labels within the plot area.Note
PieOptions.sliced_offset()
is also included in the default size calculation. As a consequence, the size of the pie may vary when points are updated and data labels more around. In that case it is best to set a fixed value, for example"75%"
.
If
True
, the accessibility module will skip past this series when executing keyboard navigation.
- property sliced_offset: int | float | Decimal | None
If a point is sliced, moved out from the center, how many pixels should it be moved? Defaults to
10
.- Return type:
numeric or
None
- property soft_threshold: bool | None
When
True
, the series will not cause the Y axis to cross the zero plane (or threshold option) unless the data actually crosses the plane. Defaults toTrue
.For example, if
False
, a series of0, 1, 2, 3
will make the Y axis show negative values according to themin_padidng
option. IfTrue
, the Y axis starts at 0.- Return type:
- property sonification: SeriesSonification | None
Sonification configuration for the series type/series.
- Return type:
- property stack: str | None
Indicates the “stack” into which the series should be grouped, if the chart groups series into stacks. Defaults to
None
.Note
The value can be a string or a numeric value, provided that series in the same stack all have the same value when converted to a string. For ease of ues, Highcharts for Python will attempt to force the conversion of the relevant value to a string.
- property stacking: str | None
Whether to stack the values of each series on top of each other. Defaults to
None
.Acceptable values are:
None
to disable stacking,"normal"
to stack by value or"percent"
'stream'
(for streamgraph series type only)'overlap'
(for waterfall series type only)
Note
When stacking is enabled, data must be sorted in ascending X order.
- property start_angle: int | float | Decimal | None
The start angle of the dependency wheel, in degrees where
0
is up. Defaults to0
.- Return type:
numeric or
None
- property states: States | None
Configuration for state-specific configuration to apply to the data series.
- Return type:
States
orNone
- property step: str | None
Whether to apply steps to the line. Defaults to
None
.Possible values are:
'left'
'center'
'right'
- property sticky_tracking: bool | None
Sticky tracking of mouse events.
When
True
, the (JavaScript)mouseOut
event on a series is not triggered until the mouse moves over another series, or out of the plot area.When
False
, the (JavaScript)mouseOut
event on a series is triggered when the mouse leaves the area around the series’ graph or markers. This also implies the tooltip when not shared.When
False
andPlotOptions.tooltip.shared()
is alsoFalse
, the tooltip will be hidden when moving the mouse between series.Defaults to
True
for line and area type series, but toFalse
for columns, pies, etc.Note
The boost module will force this option because of technical limitations.
- property thickness: int | None
Thickness describing the ring size for a donut type chart, overriding
PieOptions.inner_size()
. Defaults toNone
.
- property threshold: int | float | Decimal | EnforcedNullType | None
The Y axis value to serve as the base for the columns, for distinguishing between values above and below a threshold. Defaults to
0
.If
EnforcedNullType
, the columns extend from the padding Y axis minimum.- Return type:
numeric or
EnforcedNullType
orNone
- property tooltip: Tooltip | None
A configuration object for the tooltip rendering of each single series. Properties are inherited from tooltip, but only the following properties can be defined on a series level.
- Return type:
Tooltip
orNone
- property turbo_threshold: int | None
When a series contains a data array longer than this value, only one dimensional arrays of numbers, or two dimensional arrays with x and y values are allowed. Also, only the first point is tested, and the rest are assumed to be the same format. This saves expensive data checking and indexing in long series. Set it to
0
orNone
to disable.Defaults to
1000
.Note
In boost mode, turbo threshold is forced. Only array of numbers or two dimensional arrays are allowed.
- property type: str
Indicates the type of series that is represented by this instance.
Warning
This proprety is read-only!
- Return type:
- property visible: bool | None
If
True
, the series is initially visible. IfFalse
, the series is hidden by default. Defaults toTrue
.
- property x_axis: str | int | None
When using multiple X-axes, this setting determines on which axis the series should be drawn. Its value should be either a numerical index position in the
Options.x_axis()
array (starting at 0), or astr
indicating theid
of the axis to which the series should be connected. Defaults toNone
, which behaves as if the value were set to0
.
- property y_axis: str | int | None
When using multiple Y-axes, this setting determines on which axis the series should be drawn. Its value should be either a numerical index position in the
Options.y_axis()
array (starting at 0), or astr
indicating theid
of the axis to which the series should be connected. Defaults toNone
, which behaves as if the value were set to0
.
- property z_index: int | float | Decimal | None
The visual z-index of the series. Defaults to
None
.- Return type:
numeric or
None