.language
class: Language
- class Language(**kwargs)[source]
Collection of configuration settings for UI strings that can be adapted for display in specific languages.
Note
The
Language
object is a global setting in Highcharts and it cannot be set on each chart initialization. Instead, it has to be set using (in JavaScript)Highcharts.setOptions(...)
before any chart is initialized.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_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
- 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: AccessibilityLanguageOptions | None
Configuration of accessibility strings in the chart.
Note
Requires the accessibility module to be loaded.
For a description of the module and information on its features, see Accessibility.
Hint
For more dynamic control over the accessibility functionality, see
Accessibility.point.description_formatter()
,Accessibility.series.description_formatter()
, andAccessibility.screen_reader_section.before_chart_formatter()
.- Returns:
Accessibility strings used in the chart.
- Return type:
AccessibilityLanguageOptions
orNone
- property context_button_title: str | None
The tooltip title for the context menu holding print and export menu items.
Defaults to
'Chart context menu'
.
- property decimal_point: str | None
Decimal point used in (JavaScript)
Highcharts.numberFormat
. Defaults to.
.
- property download_csv: str | None
Text for the context menu item that allows the user to download a CSV of the chart/data. Defaults to
'Download CSV'
.
- property download_jpeg: str | None
Text for the context menu item that allows the user to download a JPEG of the chart/data. Defaults to
'Download JPEG'
.
- property download_pdf: str | None
Text for the context menu item that allows the user to download a PDF of the chart/data. Defaults to
'Download PDF'
.
- property download_png: str | None
Text for the context menu item that allows the user to download a PNG of the chart/data. Defaults to
'Download PNG'
.
- property download_svg: str | None
Text for the context menu item that allows the user to download an SVG of the chart/data. Defaults to
'Download SVG'
.
- property download_xls: str | None
Text for the context menu item that allows the user to download a Microsoft Excel file of the chart/data. Defaults to
'Download Excel'
.
- property drillup_text: str | None
The text for the button that appears when drilling down, linking back to the parent series.
Note
The parent series’ name is inserted for
{series.name}
.Defaults to
None
.
- property exit_fullscreen: str | None
The text for the menu item to exit the chart from full screen. Defaults to
'Exit from full screen'
.
- property export_data: ExportDataLanguageOptions | None
Language strings used in the exported data table.
- Return type:
ExportDataLanguageOptions
orNone
- property hide_data: str | None
Text used for the hide data table menu item. Defaults to:
'Hide data table'
.
- property invalid_date: str | None
Text to show in a date field for invalid dates. Defaults to
''
(an empty string).
- property loading: str | None
The loading text that appears when the chart is set into the loading state following a (JavaScript) call to
chart.showLoading()
. Defaults to'Loading...'
.- Return type:
str
- property main_breadcrumb: str | None
The root item in the breadcrums used when in drilldown mode. Defaults to
'Main'
.
- property months: List[str] | None
An array containing the months names. Defaults to:
[ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ]
Note
Corresponds to the
%B
format string in (JavaScript)Highcharts.dateFormat()
.
The Popup strings used in the chart.
Note
Requires the
annotations.js
orannotations-advanced.src.js
module to be loaded.- Return type:
NavigationLanguageOptions
orNone
- property no_data: str | None
The text to display when the chart contains no data. Defaults to
'No data to display'
.
- property numeric_symbol_magnitude: int | None
The magnitude of replacements for
Language.numeric_symbols()
replacements. Defaults to1000
.Hint
Use
10000
for Japanese, Korean and various Chinese locales, which use symbols for 10^4, 10^8 and 10^12.- Return type:
- property numeric_symbols: List[str] | EnforcedNullType | None
Metric suffixes used to shorten high numbers in axis labels. Defaults to
["k", "M", "G", "T", "P", "E"]
.Note
Replacing any of the positions with
None
orconstants.EnforcedNullType
causes the full number to be written. SettingLanguage.numeric_symbols()
as a whole toNone
orconstants.EnforcedNullType
disables shortening altogether.
- property print_chart: str | None
The text for the menu item to print the chart. Defaults to
'Print chart'
.
- property reset_zoom: str | None
The text for the label of the button to reset the zoom when a chart is zoomed. Defaults to
'Reset zoom'
.
- property reset_zoom_title: str | None
The text for the tooltip which appears above the button to reset the zoom when a chart is zoomed. Defaults to
'Reset zoom level 1:1'
.
- property short_months: List[str] | None
A collection containing the months names in abbreviated form. Defaults to:
[ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ]
Note
Corresponds to the
%b
format in (JavaScript)Highcharts.dateFormat()
.
- property short_weekdays: List[str] | None
Short week days, starting Sunday.
If not specified, Highcharts uses the first three letters of the
Language.weekdays()
setting.
- property thousands_separator: str | None
The default thousands separator used in the (JavaScript)
Highcharts.numberFormat()
method unless otherwise specified in the function arguments.Defaults to a single space character, which is recommended in ISO 31-0 and works across Anglo-American and continental European languages.
- property view_data: str | None
The text for the menu item to view the chart’s data table. Defaults to:
'View data table'
- property view_fullscreen: str | None
The text for the menu item to view the chart in fullscreen mode. Defaults to:
'View in full screen'
.
- property weekdays: List[str] | None
An array containing the days of the week, starting with Sunday. Defaults to:
[ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ]