Skip to content

Theme

Theme

Fluent API for configuring chart theme properties.

Build a theme by chaining property accessors and calls:

Example
theme = (Theme()
    .axis.label(color='#333', fontSize=12)
    .facet.box(fill='#f5f5f5', r=4)
    .grid.margin(bottom='15%')
)
__init__(theme=None)
to_dict()

Return the theme configuration as a dictionary.


axis

__call__(show=None, color=None, fontStyle=None, fontWeight=None, fontSize=None, EChartsOptions=None, width=None)

Configure axis theme properties.

Theme().axis.attribute or Theme().axis(...)

Attributes:

Name Type Description
title

Configure axis title styling.

label

Configure axis label styling.

ticks

Configure axis ticks styling.

line

Configure axis line styling.

Parameters:

Name Type Description Default
show Optional[bool]

Whether to display the element (True/False).

None
color Optional[str]

Hex color code (e.g., '#303030').

None
fontStyle Optional[str]

Font style (e.g., 'normal', 'italic', 'oblique').

None
fontWeight Optional[str]

Font weight (e.g., 'normal', 'bold', or numeric values like '400', '700').

None
fontSize Optional[int]

Font size in pixels (integer > 0).

None
EChartsOptions Optional[dict]

Additional ECharts options as a dictionary (for features not directly supported by gocharts).

None
width Optional[int]

Line width in pixels (number ≥ 0).

None

Returns:

Name Type Description
Theme Theme

Updated theme instance for method chaining.

axis.label

__call__(show=None, color=None, fontStyle=None, fontWeight=None, fontSize=None, EChartsOptions=None)

Configure label theme properties.

Theme().axis.label.attribute or Theme().axis.label(...)

Attributes:

Name Type Description
x

Configure label x styling.

y

Configure label y styling.

Parameters:

Name Type Description Default
show Optional[bool]

Whether to display the element (True/False).

None
color Optional[str]

Hex color code (e.g., '#303030').

None
fontStyle Optional[str]

Font style (e.g., 'normal', 'italic', 'oblique').

None
fontWeight Optional[str]

Font weight (e.g., 'normal', 'bold', or numeric values like '400', '700').

None
fontSize Optional[int]

Font size in pixels (integer > 0).

None
EChartsOptions Optional[dict]

Additional ECharts options as a dictionary (for features not directly supported by gocharts).

None

Returns:

Name Type Description
Theme Theme

Updated theme instance for method chaining.

axis.label.x

__call__(show=None, color=None, fontStyle=None, fontWeight=None, fontSize=None, EChartsOptions=None)

Configure x theme properties.

Theme().axis.label.x(...)

Parameters:

Name Type Description Default
show Optional[bool]

Whether to display the element (True/False).

None
color Optional[str]

Hex color code (e.g., '#303030').

None
fontStyle Optional[str]

Font style (e.g., 'normal', 'italic', 'oblique').

None
fontWeight Optional[str]

Font weight (e.g., 'normal', 'bold', or numeric values like '400', '700').

None
fontSize Optional[int]

Font size in pixels (integer > 0).

None
EChartsOptions Optional[dict]

Additional ECharts options as a dictionary (for features not directly supported by gocharts).

None

Returns:

Name Type Description
Theme Theme

Updated theme instance for method chaining.

axis.label.y

__call__(show=None, color=None, fontStyle=None, fontWeight=None, fontSize=None, EChartsOptions=None)

Configure y theme properties.

Theme().axis.label.y(...)

Parameters:

Name Type Description Default
show Optional[bool]

Whether to display the element (True/False).

None
color Optional[str]

Hex color code (e.g., '#303030').

None
fontStyle Optional[str]

Font style (e.g., 'normal', 'italic', 'oblique').

None
fontWeight Optional[str]

Font weight (e.g., 'normal', 'bold', or numeric values like '400', '700').

None
fontSize Optional[int]

Font size in pixels (integer > 0).

None
EChartsOptions Optional[dict]

Additional ECharts options as a dictionary (for features not directly supported by gocharts).

None

Returns:

Name Type Description
Theme Theme

Updated theme instance for method chaining.

axis.line

__call__(show=None, color=None, width=None, EChartsOptions=None)

Configure line theme properties.

Theme().axis.line.attribute or Theme().axis.line(...)

Attributes:

Name Type Description
x

Configure line x styling.

y

Configure line y styling.

Parameters:

Name Type Description Default
show Optional[bool]

Whether to display the element (True/False).

None
color Optional[str]

Hex color code (e.g., '#303030').

None
width Optional[int]

Line width in pixels (number ≥ 0).

None
EChartsOptions Optional[dict]

Additional ECharts options as a dictionary (for features not directly supported by gocharts).

None

Returns:

Name Type Description
Theme Theme

Updated theme instance for method chaining.

axis.line.x

__call__(show=None, color=None, width=None, EChartsOptions=None)

Configure x theme properties.

Theme().axis.line.x(...)

Parameters:

Name Type Description Default
show Optional[bool]

Whether to display the element (True/False).

None
color Optional[str]

Hex color code (e.g., '#303030').

None
width Optional[int]

Line width in pixels (number ≥ 0).

None
EChartsOptions Optional[dict]

Additional ECharts options as a dictionary (for features not directly supported by gocharts).

None

Returns:

Name Type Description
Theme Theme

Updated theme instance for method chaining.

axis.line.y

__call__(show=None, color=None, width=None, EChartsOptions=None)

Configure y theme properties.

Theme().axis.line.y(...)

Parameters:

Name Type Description Default
show Optional[bool]

Whether to display the element (True/False).

None
color Optional[str]

Hex color code (e.g., '#303030').

None
width Optional[int]

Line width in pixels (number ≥ 0).

None
EChartsOptions Optional[dict]

Additional ECharts options as a dictionary (for features not directly supported by gocharts).

None

Returns:

Name Type Description
Theme Theme

Updated theme instance for method chaining.

axis.ticks

__call__(show=None, color=None, width=None, EChartsOptions=None)

Configure ticks theme properties.

Theme().axis.ticks.attribute or Theme().axis.ticks(...)

Attributes:

Name Type Description
x

Configure ticks x styling.

y

Configure ticks y styling.

Parameters:

Name Type Description Default
show Optional[bool]

Whether to display the element (True/False).

None
color Optional[str]

Hex color code (e.g., '#303030').

None
width Optional[int]

Line width in pixels (number ≥ 0).

None
EChartsOptions Optional[dict]

Additional ECharts options as a dictionary (for features not directly supported by gocharts).

None

Returns:

Name Type Description
Theme Theme

Updated theme instance for method chaining.

axis.ticks.x

__call__(show=None, color=None, width=None, EChartsOptions=None)

Configure x theme properties.

Theme().axis.ticks.x(...)

Parameters:

Name Type Description Default
show Optional[bool]

Whether to display the element (True/False).

None
color Optional[str]

Hex color code (e.g., '#303030').

None
width Optional[int]

Line width in pixels (number ≥ 0).

None
EChartsOptions Optional[dict]

Additional ECharts options as a dictionary (for features not directly supported by gocharts).

None

Returns:

Name Type Description
Theme Theme

Updated theme instance for method chaining.

axis.ticks.y

__call__(show=None, color=None, width=None, EChartsOptions=None)

Configure y theme properties.

Theme().axis.ticks.y(...)

Parameters:

Name Type Description Default
show Optional[bool]

Whether to display the element (True/False).

None
color Optional[str]

Hex color code (e.g., '#303030').

None
width Optional[int]

Line width in pixels (number ≥ 0).

None
EChartsOptions Optional[dict]

Additional ECharts options as a dictionary (for features not directly supported by gocharts).

None

Returns:

Name Type Description
Theme Theme

Updated theme instance for method chaining.

axis.title

__call__(show=None, color=None, fontStyle=None, fontWeight=None, fontSize=None, EChartsOptions=None)

Configure title theme properties.

Theme().axis.title.attribute or Theme().axis.title(...)

Attributes:

Name Type Description
x

Configure title x styling.

y

Configure title y styling.

Parameters:

Name Type Description Default
show Optional[bool]

Whether to display the element (True/False).

None
color Optional[str]

Hex color code (e.g., '#303030').

None
fontStyle Optional[str]

Font style (e.g., 'normal', 'italic', 'oblique').

None
fontWeight Optional[str]

Font weight (e.g., 'normal', 'bold', or numeric values like '400', '700').

None
fontSize Optional[int]

Font size in pixels (integer > 0).

None
EChartsOptions Optional[dict]

Additional ECharts options as a dictionary (for features not directly supported by gocharts).

None

Returns:

Name Type Description
Theme Theme

Updated theme instance for method chaining.

axis.title.x

__call__(show=None, color=None, fontStyle=None, fontWeight=None, fontSize=None, EChartsOptions=None)

Configure x theme properties.

Theme().axis.title.x(...)

Parameters:

Name Type Description Default
show Optional[bool]

Whether to display the element (True/False).

None
color Optional[str]

Hex color code (e.g., '#303030').

None
fontStyle Optional[str]

Font style (e.g., 'normal', 'italic', 'oblique').

None
fontWeight Optional[str]

Font weight (e.g., 'normal', 'bold', or numeric values like '400', '700').

None
fontSize Optional[int]

Font size in pixels (integer > 0).

None
EChartsOptions Optional[dict]

Additional ECharts options as a dictionary (for features not directly supported by gocharts).

None

Returns:

Name Type Description
Theme Theme

Updated theme instance for method chaining.

axis.title.y

__call__(show=None, color=None, fontStyle=None, fontWeight=None, fontSize=None, EChartsOptions=None)

Configure y theme properties.

Theme().axis.title.y(...)

Parameters:

Name Type Description Default
show Optional[bool]

Whether to display the element (True/False).

None
color Optional[str]

Hex color code (e.g., '#303030').

None
fontStyle Optional[str]

Font style (e.g., 'normal', 'italic', 'oblique').

None
fontWeight Optional[str]

Font weight (e.g., 'normal', 'bold', or numeric values like '400', '700').

None
fontSize Optional[int]

Font size in pixels (integer > 0).

None
EChartsOptions Optional[dict]

Additional ECharts options as a dictionary (for features not directly supported by gocharts).

None

Returns:

Name Type Description
Theme Theme

Updated theme instance for method chaining.

facet

__call__(show=None, color=None, fontStyle=None, fontWeight=None, fontSize=None, EChartsOptions=None, fill=None, stroke=None, lineWidth=None, r=None)

Configure facet theme properties.

Theme().facet.attribute or Theme().facet(...)

Attributes:

Name Type Description
label

Configure facet label styling.

box

Configure facet box styling.

Parameters:

Name Type Description Default
show Optional[bool]

Whether to display the element (True/False).

None
color Optional[str]

Hex color code (e.g., '#303030').

None
fontStyle Optional[str]

Font style (e.g., 'normal', 'italic', 'oblique').

None
fontWeight Optional[str]

Font weight (e.g., 'normal', 'bold', or numeric values like '400', '700').

None
fontSize Optional[int]

Font size in pixels (integer > 0).

None
EChartsOptions Optional[dict]

Additional ECharts options as a dictionary (for features not directly supported by gocharts).

None
fill Optional[str]

Fill color for shapes (e.g., '#ffffff').

None
stroke Optional[str]

Stroke/border color (e.g., '#000000').

None
lineWidth Optional[int]

Line/stroke width in pixels (number ≥ 0).

None
r Optional[int]

Border radius for rectangles (number ≥ 0).

None

Returns:

Name Type Description
Theme Theme

Updated theme instance for method chaining.

facet.box

__call__(show=None, fill=None, stroke=None, lineWidth=None, r=None, EChartsOptions=None)

Configure box theme properties.

Theme().facet.box.attribute or Theme().facet.box(...)

Attributes:

Name Type Description
col

Configure box col styling.

row

Configure box row styling.

Parameters:

Name Type Description Default
show Optional[bool]

Whether to display the element (True/False).

None
fill Optional[str]

Fill color for shapes (e.g., '#ffffff').

None
stroke Optional[str]

Stroke/border color (e.g., '#000000').

None
lineWidth Optional[int]

Line/stroke width in pixels (number ≥ 0).

None
r Optional[int]

Border radius for rectangles (number ≥ 0).

None
EChartsOptions Optional[dict]

Additional ECharts options as a dictionary (for features not directly supported by gocharts).

None

Returns:

Name Type Description
Theme Theme

Updated theme instance for method chaining.

facet.box.col

__call__(show=None, fill=None, stroke=None, lineWidth=None, r=None, EChartsOptions=None)

Configure col theme properties.

Theme().facet.box.col(...)

Parameters:

Name Type Description Default
show Optional[bool]

Whether to display the element (True/False).

None
fill Optional[str]

Fill color for shapes (e.g., '#ffffff').

None
stroke Optional[str]

Stroke/border color (e.g., '#000000').

None
lineWidth Optional[int]

Line/stroke width in pixels (number ≥ 0).

None
r Optional[int]

Border radius for rectangles (number ≥ 0).

None
EChartsOptions Optional[dict]

Additional ECharts options as a dictionary (for features not directly supported by gocharts).

None

Returns:

Name Type Description
Theme Theme

Updated theme instance for method chaining.

facet.box.row

__call__(show=None, fill=None, stroke=None, lineWidth=None, r=None, EChartsOptions=None)

Configure row theme properties.

Theme().facet.box.row(...)

Parameters:

Name Type Description Default
show Optional[bool]

Whether to display the element (True/False).

None
fill Optional[str]

Fill color for shapes (e.g., '#ffffff').

None
stroke Optional[str]

Stroke/border color (e.g., '#000000').

None
lineWidth Optional[int]

Line/stroke width in pixels (number ≥ 0).

None
r Optional[int]

Border radius for rectangles (number ≥ 0).

None
EChartsOptions Optional[dict]

Additional ECharts options as a dictionary (for features not directly supported by gocharts).

None

Returns:

Name Type Description
Theme Theme

Updated theme instance for method chaining.

facet.label

__call__(show=None, color=None, fontStyle=None, fontWeight=None, fontSize=None, EChartsOptions=None)

Configure label theme properties.

Theme().facet.label.attribute or Theme().facet.label(...)

Attributes:

Name Type Description
col

Configure label col styling.

row

Configure label row styling.

Parameters:

Name Type Description Default
show Optional[bool]

Whether to display the element (True/False).

None
color Optional[str]

Hex color code (e.g., '#303030').

None
fontStyle Optional[str]

Font style (e.g., 'normal', 'italic', 'oblique').

None
fontWeight Optional[str]

Font weight (e.g., 'normal', 'bold', or numeric values like '400', '700').

None
fontSize Optional[int]

Font size in pixels (integer > 0).

None
EChartsOptions Optional[dict]

Additional ECharts options as a dictionary (for features not directly supported by gocharts).

None

Returns:

Name Type Description
Theme Theme

Updated theme instance for method chaining.

facet.label.col

__call__(show=None, color=None, fontStyle=None, fontWeight=None, fontSize=None, EChartsOptions=None)

Configure col theme properties.

Theme().facet.label.col(...)

Parameters:

Name Type Description Default
show Optional[bool]

Whether to display the element (True/False).

None
color Optional[str]

Hex color code (e.g., '#303030').

None
fontStyle Optional[str]

Font style (e.g., 'normal', 'italic', 'oblique').

None
fontWeight Optional[str]

Font weight (e.g., 'normal', 'bold', or numeric values like '400', '700').

None
fontSize Optional[int]

Font size in pixels (integer > 0).

None
EChartsOptions Optional[dict]

Additional ECharts options as a dictionary (for features not directly supported by gocharts).

None

Returns:

Name Type Description
Theme Theme

Updated theme instance for method chaining.

facet.label.row

__call__(show=None, color=None, fontStyle=None, fontWeight=None, fontSize=None, EChartsOptions=None)

Configure row theme properties.

Theme().facet.label.row(...)

Parameters:

Name Type Description Default
show Optional[bool]

Whether to display the element (True/False).

None
color Optional[str]

Hex color code (e.g., '#303030').

None
fontStyle Optional[str]

Font style (e.g., 'normal', 'italic', 'oblique').

None
fontWeight Optional[str]

Font weight (e.g., 'normal', 'bold', or numeric values like '400', '700').

None
fontSize Optional[int]

Font size in pixels (integer > 0).

None
EChartsOptions Optional[dict]

Additional ECharts options as a dictionary (for features not directly supported by gocharts).

None

Returns:

Name Type Description
Theme Theme

Updated theme instance for method chaining.

grid

__call__(top=None, right=None, bottom=None, left=None, cols=None, rows=None)

Configure grid theme properties.

Theme().grid.attribute or Theme().grid(...)

Attributes:

Name Type Description
margin

Configure grid margin styling.

facet

Configure grid facet styling.

Parameters:

Name Type Description Default
top Optional[str | int]

Top margin/padding in pixels.

None
right Optional[str | int]

Right margin/padding in pixels.

None
bottom Optional[str | int]

Bottom margin/padding in pixels.

None
left Optional[str | int]

Left margin/padding in pixels.

None
cols Optional[str | int]

Horizontal spacing between columns in pixels.

None
rows Optional[str | int]

Vertical spacing between rows in pixels.

None

Returns:

Name Type Description
Theme Theme

Updated theme instance for method chaining.

grid.facet

__call__(cols=None, rows=None)

Configure facet theme properties.

Theme().grid.facet.attribute or Theme().grid.facet(...)

Attributes:

Name Type Description
spacing

Configure facet spacing styling.

Parameters:

Name Type Description Default
cols Optional[str | int]

Horizontal spacing between columns in pixels.

None
rows Optional[str | int]

Vertical spacing between rows in pixels.

None

Returns:

Name Type Description
Theme Theme

Updated theme instance for method chaining.

grid.facet.spacing

__call__(cols=None, rows=None)

Configure spacing theme properties.

Theme().grid.facet.spacing(...)

Parameters:

Name Type Description Default
cols Optional[str | int]

Horizontal spacing between columns in pixels.

None
rows Optional[str | int]

Vertical spacing between rows in pixels.

None

Returns:

Name Type Description
Theme Theme

Updated theme instance for method chaining.

grid.margin

__call__(top=None, right=None, bottom=None, left=None)

Configure margin theme properties.

Theme().grid.margin(...)

Parameters:

Name Type Description Default
top Optional[str | int]

Top margin/padding in pixels.

None
right Optional[str | int]

Right margin/padding in pixels.

None
bottom Optional[str | int]

Bottom margin/padding in pixels.

None
left Optional[str | int]

Left margin/padding in pixels.

None

Returns:

Name Type Description
Theme Theme

Updated theme instance for method chaining.

legend

__call__(show=None, color=None, fontSize=None, fontWeight=None, EChartsOptions=None)

Configure legend theme properties.

Theme().legend(...)

Parameters:

Name Type Description Default
show Optional[bool]

Whether to display the element (True/False).

None
color Optional[str]

Hex color code (e.g., '#303030').

None
fontSize Optional[int]

Font size in pixels (integer > 0).

None
fontWeight Optional[str]

Font weight (e.g., 'normal', 'bold', or numeric values like '400', '700').

None
EChartsOptions Optional[dict]

Additional ECharts options as a dictionary (for features not directly supported by gocharts).

None

Returns:

Name Type Description
Theme Theme

Updated theme instance for method chaining.