Apply the RO echarts theme to an echarts4r object
ro_e_theme.Rdro_e_theme() applies the Rijksoverheid (RO) visual style to
an echarts4r chart. It is the echarts
equivalent of ROvis.ggplot2::ro_gg_theme() and is designed to slot into any echarts4r
pipeline.
The theme is generated at call time from ROvis.utils::ro_color() and ROvis.utils::ro_color_palette().
A custom accessible HTML legend is always included. The native ECharts
legend is replaced automatically to meet the RO accessibility spec.
Arguments
- e
An echarts4r object (created with
echarts4r::e_charts()).- palette
Character. Palette to use for series colors. One of
"categorical"(default),"gender_con", or"gender_unc". Passed toro_color_palette().- fixed_aspect
Logical. When
TRUE(default), the total element (title + chart + legend) maintains a 2:1 width-to-height ratio, and the inner plot area (grid only, excluding axis labels and legend) maintains a 3:1 width-to-height ratio. Both ratios update responsively on resize. Set toFALSEto let the chart fill whatever height its container provides (useful when embedding in a fixed-size layout or a Shiny app with explicitheight).- font
NULL(default) or a character string naming a system font family. WhenNULL, RijksoverheidSansWebText is used if installed, otherwise Verdana. Supply a font name to override both the chart labels and the custom HTML legend. A warning is issued if the font is not found on the system.- renderer
The renderer to use. One of
"svg"or"canvas". Defaults to"svg"to comply with accessibility standards.
RO style applied
Series colors from
ro_color_palette()(default:"categorical").Title in
ro_color("lintblauw"), subtitle inro_color("donkerblauw").Axis labels and ticks in
ro_color("grijs_7").Horizontal grid lines (value axis); no vertical grid lines.
No axis line or ticks on the value axis.
Custom HTML legend with per-item borders and hover/hidden styles.
See also
ROvis.ggplot2::ro_gg_theme()for the ggplot2 equivalent.ro_e_keyboard_nav()to add keyboard accessibility on top of the theme.ROvis.utils::ro_color_palette()to inspect the available palettes.ROvis.utils::ro_color()to look up individual RO color hex codes.
Other echarts4r:
ro_e_build_keyboard_nav_js(),
ro_e_build_onrender_js(),
ro_e_detect_axis_orientation(),
ro_e_keyboard_nav(),
ro_e_keyboard_nav_axis_js(),
ro_e_keyboard_nav_legend_js(),
ro_e_theme_list()