.options.chart
class: ChartOptions
- class ChartOptions(**kwargs)[source]
- Configuration settings that apply to a chart. - Class Inheritance - copy(other=None, overwrite=True, **kwargs)
- Copy the configuration settings from this instance to the - otherinstance.- Parameters:
- other ( - HighchartsMeta) – The target instance to which the properties of this instance should be copied. If- None, will create a new instance and populate it with properties copied from- self. Defaults to- None.
- overwrite ( - bool) – if- True, properties in- otherthat are already set will be overwritten by their counterparts in- self. Defaults to- True.
- kwargs – Additional keyword arguments. Some special descendents of - HighchartsMetamay have special implementations of this method which rely on additional keyword arguments.
 
- Returns:
- A mutated version of - otherwith new property values
 
 - classmethod from_dict(as_dict: dict, allow_snake_case: bool = True)
- Construct an instance of the class from a - dictobject.
 - 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 a- stror as a filename which contains the JS object literal.
- allow_snake_case ( - bool) – If- True, interprets- snake_casekeys as equivalent to- camelCasekeys. Defaults to- True.
- _break_loop_on_failure ( - bool) – If- True, will break any looping operations in the event of a failure. Otherwise, will attempt to repair the failure. Defaults to- False.
 
- 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) – If- True, interprets- snake_casekeys as equivalent to- camelCasekeys. Defaults to- True.
 
- Returns:
- A Python objcet representation of - as_json.
- Return type:
- HighchartsMeta
 
 - to_dict() dict
- Generate a - dictrepresentation of the object compatible with the Highcharts JavaScript library.- Note - The - dictrepresentation 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 - strcontaining 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 - stror a- bytesobject depending on the JSON serialization library you are using. For example, if your environment has orjson, the result will be a- bytesrepresentation 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 - untrimmedwhose values are- Noneand convert values that have- .to_dict()methods.
 - static trim_iterable(untrimmed, to_json=False)
- Convert any - EnforcedNullTypevalues in- untrimmedto- 'null'.
 - property align_thresholds: bool | None
- When using multiple axes, align the thresholds. When - True, other ticks will also be aligned. Defaults to- False.- Note - For line series and some other series types, the threshold option is set to - nullby default. This will in turn cause their y-axis to not have a threshold. In order to avoid that, set the series threshold to- 0or another number.- Note - If - AxisOptions.start_on_tick()or- AxisOptions.end_on_tick()are set to- False, or if the axis is logarithmic, the threshold will not be aligned.
 - property align_ticks: bool | None
- If - Trueand using multiple axes, the ticks of two or more opposite axes will automatically be aligned by adding ticks to the axis or axes with the least ticks, as if- tick_amountwere specified. This can be prevented by setting- align_ticksto- False.- Defaults to - True.- Hint - If the grid lines look messy, it’s a good idea to hide them for the secondary axis by setting - grid_line_widthto- 0.- Warning - If - start_on_tickor- end_on_tickin the axis options are set to- False, then tick alignment will be disabled for the axis.- Warning - Aways disabled for logarithmic axes. 
 - property allow_mutating_data: bool | None
- If - True, the original data source will be allowed to be mutated. However, if- Falsethen Highcharts will create a copy of the original data to prevent inadvertent mutation. Defaults to- True.- Note - By default, (for memory and performance reasons) the chart does not copy the data but keeps it as a reference. - In some cases, this might result in mutating the original data source. In order to prevent that, set this property to - False. Please note that changing this may decrease performance, especially with bigger sets of data.
 - property animation: bool | AnimationOptions | None
- Configures the overall animation for all chart updating. - The animation can be configured as either a boolean or a - AnimationOptionsobject. If- True, it will apply the- 'swing'jQuery easing and a duration of 500 ms by default. If used as a- AnimationOptionsinstance, you have more fine-grianed configuration control.- Animation can be disabled throughout the chart by setting it to - Falsehere. It can be overridden for each individual API method as a function parameter. The only animation not affected by this option is the initial series animation, see- PlotOptions.series.animation().- When zooming on a series with less than 100 points, the chart redraw will be done with animation, but in case of more data points, it is necessary to set this option to ensure animation on zoom. - Returns:
- Settings for the animation of image patterns. 
- Return type:
- AnimationOptionsor- None
 
 - property background_color: str | Gradient | Pattern | None
- The background color or gradient for the outer chart area. Defaults to - '#ffffff'.
 - property border_color: str | Gradient | Pattern | None
- The color of the outer chart border. Defaults to - '#335cad'.
 - property border_radius: int | float | Decimal | None
- The border radius (in pixels) applied to the outer chart border. Defaults to - 0.- Returns:
- The border radius to apply to the outer chart border. 
- Return type:
- numeric or - None
 
 - property border_width: int | float | Decimal | None
- The border width (in pixels) applied to the outer chart border. Defaults to - 0.- Returns:
- The border width to apply to the outer chart border. 
- Return type:
- numeric or - None
 
 - property color_count: int | None
- In styled mode, sets how many colors the class names should rotate between. Defaults to - 10- With ten colors, series (or points) are given class names like - highcharts-color-0,- highcharts-color-0[…]- highcharts-color-9. The equivalent in non-styled mode is to set colors using the colors setting.
 - property display_errors: bool | None
- If - True, will display errors on the chart itself. If- False, will only report errors to the console. Defaults to- True.
 - property events: ChartEvents | None
- Definition of JavaScript event listeners to apply to the chart. - Return type:
- ChartEventsor- None
 
 - property height: EnforcedNullType | int | float | Decimal | str | None
- An explicit height for the chart. Defaults to - None.- If a number, the height is given in pixels. If given a percentage string (for example - '56%'), the height is given as the percentage of the actual chart width. This allows for preserving the aspect ratio across responsive sizes.- By default (when - None python:None>) the height is calculated from the offset height of the containing element, or 400 pixels if the containing element’s height is 0.
 - If - True, the axes will scale to the remaining visible series once one series is hidden. If- False, hiding and showing a series will not affect the axes or the other series.- Defaults to - True.- Note - For stacks, once one series within the stack is hidden, the rest of the stack will close in around it even if the axis is not affected. 
 - property inverted: bool | None
- If - True, inverts the axes so that the x-axis is vertical and y-axis is horizontal. Defaults to- False.- Hint - When - True, the x-axis is reversed by default.- Warning - If a bar series is present in the chart, it will be inverted automatically. - Hint - Inverting the chart doesn’t have an effect if there are no cartesian series in the chart, or if the chart is a polar chart type. 
 - property margin: List[int | float | Decimal] | None
- The margin between the outer edge of the chart and the plot area. The numbers in the array designate top, right, bottom and left respectively. - By default there is no margin. The actual space is dynamically calculated from the offset of axis labels, axis title, title, subtitle and legend in addition to the - spacing_top,- spacing_right,- spacing_bottomand- spacing_leftoptions.- Note - This property is a convenience property to consolidate simple margin configuration across the - margin_top,- margin_right,- margin_bottom, and- margin_leftoptions. Values will be propagated between all options.
 - property margin_bottom: int | float | Decimal | None
- The margin between the bottom outer edge of the chart and the plot area. Use this to set a fixed pixel value for the margin as opposed to the default dynamic margin. - By default, not set. - See also - Chart.spacing_bottom()
 - Return type:
- numeric or - None
 
 - property margin_left: int | float | Decimal | None
- The margin between the left outer edge of the chart and the plot area. Use this to set a fixed pixel value for the margin as opposed to the default dynamic margin. - By default, not set. - See also - Chart.spacing_left()
 - Return type:
- numeric or - None
 
 - property margin_right: int | float | Decimal | None
- The margin between the right outer edge of the chart and the plot area. Use this to set a fixed pixel value for the margin as opposed to the default dynamic margin. - By default, not set. - See also - Chart.spacing_right()
 - Return type:
- numeric or - None
 
 - property margin_top: int | float | Decimal | None
- The margin between the top outer edge of the chart and the plot area. Use this to set a fixed pixel value for the margin as opposed to the default dynamic margin. - By default, not set. - See also - Chart.spacing_top()
 - Return type:
- numeric or - None
 
 - property number_formatter: CallbackFunction | None
- JavaScript Callback function to override the default function that formats all the numbers in the chart. Returns a string with the formatted number. - Return type:
- CallbackFunctionor- None
 
 - property options_3d: Options3D | None
- Options to render charts in three dimensions. - Note - This feature requires the JavaScript - highcharts-3d.jsmodule, found in the download package or online at code.highcharts.com/highcharts-3d.js.- Return type:
- Options3Dor- None
 
 - property pan_key: str | None
- Allows setting a key to switch between zooming and panning. - Accepts the following values: - 'alt'
- 'ctrl'
- 'meta'(the command key on Mac and Windows key on Windows)
- 'shift'.
 - The keys are mapped directly to the key properties of the click event argument ( - event.altKey,- event.ctrlKey,- event.metaKey, and- event.shiftKey).
 - property panning: PanningOptions | None
- Configures panning behavior in a chart. - Hint - Best used with - Chart.pan_key()to combine zooming and panning.- Note - On touch devices, when the - Tooltip.follow_touch_move()property is- True(default), panning requires two fingers. To allow panning with one finger, set- follow_touch_moveto- False.- Returns:
- Configuration settings for panning behavior. 
- Return type:
 
 - property parallel_axes: ParallelAxesOptions | None
- Common options for all Y-Axes rendered in a parallel coordinates plot. - Note - This feature requires in JavaScript - modules/parallel-coordinates.js.- Return type:
- ParallelAxesOptionsor- None
 
 - property parallel_coordinates: bool | None
- If - True, renders charts as a parallel coordinates plot. Defaults to- False.- In a parallel coordinates plot (||-coords) by default all required Y-axes are generated and the legend is disabled. - Note - This feature requires the JavaScript module - modules/parallel-coordinates.js.- See also 
 - property plot_background_color: str | Gradient | Pattern | None
- The background color or gradient for the plot area. Defaults to - None.
 - property plot_background_image: str | None
- The URL for an image to use as the background of the plot area. - Hint - To set an image as the background for the entire chart, set a CSS background image to the container element. - Note - Note that for the image to be applied to exported charts, its URL needs to be accessible by the export server. - Return type:
- Raises:
- HighchartsValueError – if a value is supplied that is not a URL or not path-like 
 
 - property plot_border_color: str | Gradient | Pattern | None
- The color of the outer chart border. Defaults to - '#cccccc'.
 - property plot_border_width: int | float | Decimal | None
- The border width (in pixels) applied to the outer chart border. Defaults to - 0.- Returns:
- The border width to apply to the outer chart border. 
- Return type:
- numeric or - None
 
 - property plot_shadow: bool | ShadowOptions | None
- Configuration of a drop shadow applied to the plot area. Accepts either a boolean value of - Falsewhich disables any shadow, or a- ShadowOptionsinstance with the applicable configuration.- Defaults to - False.- Warning - Requires that - Chart.plot_background_color()be set.
 - property polar: bool | None
- If - True, cartesian charts like line, spline, area, and column are transformed into the polar coordinate system. This produces polar charts (also known as radar charts). Defaults to- False.
 - property reflow: bool | None
- If - True, reflows the chart to fit the width of the container- divwhen the window is resized. Defaults to- True.
 - property render_to: str | None
- The ID of the HTML element where the chart will be rendered. - Note - In JavaScript, the HTML element can also be passed by direct reference, or as the first argument of the chart constructor, in which case the option is not needed. 
 - property scrollable_plot_area: ScrollablePlotArea | None
- Configuration settings to make the plot area scrollable. - This feature provides a minimum size for the plot area of the chart. If the size gets smaller than this, typically on mobile devices, a native browser scrollbar is presented. This scrollbar provides smooth scrolling for the contents of the plot area, whereas the title, legend and unaffected axes are fixed. - Hint - Since v7.1.2, a scrollable plot area can be defined for either horizontal or vertical scrolling, depending on whether the minimum_width or minimum_height options are set. - Return type:
- ScrollablePlotAreaor- None
 
 - property selection_marker_fill: str | Gradient | Pattern | None
- The background color or the marker square when selecting (zooming in on) an area of the chart. Defaults to - 'rgba(51,92,173,0.25)'.
 - property shadow: bool | ShadowOptions | None
- Configuration of a drop shadow applied to the outer chart area. Accepts either a boolean value of - Falsewhich disables any shadow, or a- ShadowOptionsinstance with the applicable configuration.- Defaults to - False.- Warning - Requires that - Chart.background_color()be set.
 - property show_axes: bool | None
- If - True, shows axes initially (before series have been added to the chart).- Warning - This property only applies to empty charts where series are added dynamically. 
 - property spacing: List[int | float | Decimal] | None
- The distance between the outer edge of the chart and the content, like title or legend, or axis title and labels if present. The numbers in the array designate top, right, bottom and left respectively. - By default, - [10,10,15,10].- Note - This property is a convenience property to consolidate simple spacing configuration across the - spacing_top,- spacing_right,- spacing_bottom, and- spacing_leftoptions. Values will be propagated between all options.
 - property spacing_bottom: int | float | Decimal | None
- The spacing between the bottom edge of the chart and the content (plot area, axis title and labels, title, subtitle or legend in top position). - By default, - 15.- Return type:
- numeric or - None
 
 - property spacing_left: int | float | Decimal | None
- The spacing between the left edge of the chart and the content (plot area, axis title and labels, title, subtitle or legend in top position). - Defaults to - 10.- Return type:
- numeric or - None
 
 - property spacing_right: int | float | Decimal | None
- The spacing between the right edge of the chart and the content (plot area, axis title and labels, title, subtitle or legend in top position). - Defaults to - 10.- Return type:
- numeric or - None
 
 - property spacing_top: int | float | Decimal | None
- The spacing between the top edge of the chart and the content (plot area, axis title and labels, title, subtitle or legend in top position). - Defaults to - 10.- Return type:
- numeric or - None
 
 - property style: str | None
- Additional CSS styles to apply inline to the container div. - Defaults to - '{"fontFamily": ""Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif","fontSize":"12px"}'.- Note - Since the default font styles are applied in the renderer, it is ignorant of the individual chart options and must be set globally. 
 - property styled_mode: bool | None
- If - True, sets the chart to operate in styled mode, where no presentational attributes or CSS are applied to the chart SVG. Instead, CSS rules are required to style the chart. Defaults to- False.- See also - The Default Style Sheet: https://code.highcharts.com/css/highcharts.css. 
 
 - property type: str | None
- The default series type for the chart. Defaults to - 'line'.- Can be any of the chart types listed under - PlotOptionsand- Series, or can be a series provided by an additional module.
 - property width: EnforcedNullType | int | float | Decimal | str | None
- An explicit width for the chart. - Defaults to - EnforcedNull <EnforcedNullType>`which indicates a JavaScript value of- null(as opposed to- Nonewhich results in- undefinedwhen converted JavaScript.)- If a number, the width is given in pixels. If given a percentage string (for example - '56%'), the width is given as the percentage of the actual chart width. This allows for preserving the aspect ratio across responsive sizes.- By default (when null) the width is calculated from the offset width of the containing element. 
 - property zooming: ZoomingOptions | None
- Chart zooming configuration. - Return type:
- ZoomingOptionsor- None
 
 
class: PanningOptions
- class PanningOptions(**kwargs)[source]
- Configures panning behavior in a chart. - Hint - Best used with - Chart.pan_key()to combine zooming and panning.- Note - On touch devices, when the - Tooltip.follow_touch_move()property is- True(default), panning requires two fingers. To allow panning with one finger, set- follow_touch_moveto- False.- Class Inheritance - copy(other=None, overwrite=True, **kwargs)
- Copy the configuration settings from this instance to the - otherinstance.- Parameters:
- other ( - HighchartsMeta) – The target instance to which the properties of this instance should be copied. If- None, will create a new instance and populate it with properties copied from- self. Defaults to- None.
- overwrite ( - bool) – if- True, properties in- otherthat are already set will be overwritten by their counterparts in- self. Defaults to- True.
- kwargs – Additional keyword arguments. Some special descendents of - HighchartsMetamay have special implementations of this method which rely on additional keyword arguments.
 
- Returns:
- A mutated version of - otherwith new property values
 
 - classmethod from_dict(as_dict: dict, allow_snake_case: bool = True)
- Construct an instance of the class from a - dictobject.
 - 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 a- stror as a filename which contains the JS object literal.
- allow_snake_case ( - bool) – If- True, interprets- snake_casekeys as equivalent to- camelCasekeys. Defaults to- True.
- _break_loop_on_failure ( - bool) – If- True, will break any looping operations in the event of a failure. Otherwise, will attempt to repair the failure. Defaults to- False.
 
- 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) – If- True, interprets- snake_casekeys as equivalent to- camelCasekeys. Defaults to- True.
 
- Returns:
- A Python objcet representation of - as_json.
- Return type:
- HighchartsMeta
 
 - to_dict() dict
- Generate a - dictrepresentation of the object compatible with the Highcharts JavaScript library.- Note - The - dictrepresentation 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 - strcontaining 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 - stror a- bytesobject depending on the JSON serialization library you are using. For example, if your environment has orjson, the result will be a- bytesrepresentation 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 - untrimmedwhose values are- Noneand convert values that have- .to_dict()methods.
 - static trim_iterable(untrimmed, to_json=False)
- Convert any - EnforcedNullTypevalues in- untrimmedto- 'null'.
 
Sub-components
| Module | Classes / Functions | 
|---|---|