
This is a highly customizable graph card for Home-Assistant's Lovelace UI.
It is based on ApexCharts.js and offers most of the features of the library.
It is also inspired by the great mini-graph-card by @kalkih
However, some things might be broken :grin:
series Optionsshow Optionsheader_actions or title_actions options*_action optionsconfirmation optionsstatistics optionsshow Optionsheader Optionsnow Optionsgroup_by Optionsfunc Optionschart_type Optionsspan Optionstransform Optiondata_generator Optionyaxis Options. Multi-Y axis
color_threshold experimental featurehidden_by_default experimental featurebrush experimental featureThis card is available in HACS (Home Assistant Community Store). HACS is a third-party community store and is not included in Home Assistant out of the box.
Download and copy apexcharts-card.js from the latest release into your config/www directory.
Add the resource reference as described below.
Move into your config/www directory.
Grab apexcharts-card.js:
$ wget https://github.com/RomRider/apexcharts-card/releases/download/v2.2.3/apexcharts-card.js
If you configure Lovelace via YAML, add a reference to apexcharts-card.js inside your configuration.yaml:
resources:
- url: /local/apexcharts-card.js?v=2.2.3
type: module
Else, if you prefer the graphical editor, use the menu to add the resource:
/local/apexcharts-card.js and select type "JavaScript Module".This diagram shows how your data goes through all the steps allowed by this card:

:warning: Since this card is in its debut, you should expect breaking changes moving forward. :warning:
The card strictly validates all the options available (but not for the apex_config object). If there is an error in your configuration, it will tell you where and display a red error card.
:white_check_mark: means required.
| Name | Type | Default | Since | Description |
|---|---|---|---|---|
:white_check_mark: type |
string | v1.0.0 | custom:apexcharts-card |
|
:white_check_mark: series |
array | v1.0.0 | See series | |
section_mode |
boolean | false |
v2.2.0 | Set to true when the card is used in a section view (sets CSS height to 100%). See Sections Views |
config_templates |
array | v1.6.0 | Define a configuration once and reuse it multiple times. See config_templates | |
color_list |
array | v1.6.0 | Define the array of colors applied to the series. Will be overridden by each series's color if defined. Useful for config_templates mainly. |
|
all_series_config |
object | v1.6.0 | If something is defined here it will apply this config to all the series. It accepts the same options as a series minus entity. It is useful to avoid repetition but the same thing can be achieved in each series individually. See series and all_series_config for an example |
|
chart_type |
string | line |
v1.4.0 | See chart_type |
update_interval |
string | v1.1.0 | By default the card updates on every state change. Setting this overrides the behaviour. Valid values are any time string, eg: 1h, 12min, 1d, 1h25, 10sec, ... |
|
update_delay |
string | 1500ms |
v1.4.0 | If the chart doesn't display the last state but the one before, you'll want to increase this value, don't go over 10s, it's not necessary. You'll also want to increase this value if you are using attribute in the series. Valid values are any time strings. This is because of how Home-Assistant works with history, see here |
graph_span |
string | 24h |
v1.1.0 | The span of the graph as a time interval. Valid values are any time string, eg: 1h, 12min, 1d, 1h25, 10sec, ... |
span |
object | v1.2.0 | See span | |
show |
object | v1.0.0 | See show | |
hours_12 |
boolean | v1.8.0 | If undefined, it will follow Home-Assistant's user time format. If true, it will force time to be displayed in 12h format. If false it will force the time to be displayed in 24h format. |
|
cache |
boolean | true |
v1.0.0 | Use in-browser data caching to reduce the load on Home Assistant's server |
stacked |
boolean | false |
v1.0.0 | Enable if you want the data to be stacked on the graph |
layout |
string | v1.0.0 | See layouts | |
header |
object | v1.0.0 | See header | |
now |
object | v1.5.0 | See now | |
~~y_axis_precision~~ |
~~number~~ | ~~1~~ |
~~v1.2.0~~ | DEPRECATED since v1.10.0 ~~The float precision used to display numbers on the Y axis. Only works if yaxis is undefined.~~ |
yaxis |
array | v1.9.0 | See yaxis | |
apex_config |
object | v1.0.0 | Apexcharts API 1:1 mapping. You can see all the options here --> Options (Reference) in the Menu. See Apex Charts |
|
experimental |
object | v1.6.0 | See experimental | |
locale |
string | v1.7.0 | Default is to inherit from Home-Assistant's user configuration. This overrides it and forces the locale. Eg: en, or fr. Reverts to en if the locale is unknown. |
|
brush |
object | v1.8.0 | See brush |
series Options| Name | Type | Default | Since | Description |
|---|---|---|---|---|
:white_check_mark: entity |
string | v1.0.0 | The entity_id of the sensor to display |
|
attribute |
string | v1.4.0 | Instead of retrieving the state, it will retrieve an attribute of the entity. Make sure you increase update_delay if the chart doesn't reflect the last value of the attribute |
|
name |
string | v1.0.0 | Override the name of the entity | |
stack_group |
string | v2.1.0 | When stacked is true, groups the different series with the name stack_group together. Only works for type: column. All series' names need to be be unique because of a bug in apexcharts.js |
|
color |
string | v1.1.0 | Color of the serie. Supported formats: yellow, #aabbcc, rgb(128, 128, 128) or var(--css-color-variable) |
|
opacity |
number | 0.7 for area |
else 1 | v1.6.0 | The opacity of the line or filled area, between 0 and 1 |
| stroke_width | number | 5 | v1.6.0 | Change the width of the line. Only works for area and line |
| stroke_dash | number or array | 0 | v2.1.0 | Creates a dashed line. The higher the number, the bigger the dash. An array can be used to specify more complex patterns. |
| type | string | line | v1.0.0 | line, area or column are supported for now |
| curve | string | smooth | v1.0.0 | smooth (nice curve), straight (direct line between points) or stepline (flat line until next point then straight up or down), monotoneCubic (create a monotone cubic spline) |
| ~~extend_to_end~~ | ~~boolean~~ | ~~true~~ | ~~v1.0.0~~ | DEPRECATED since v2.0.0 ~~If the last data is older than the end time displayed on the graph, setting to true will extend the value until the end of the timeline. Only works for line and area types.~~ |
| extend_to | boolean or string | end | v2.0.0 | If the value is end, it will extend the line/area to the end of the chart. With now, it will extend it to the current time (usefull for chart showing current and future data). If false it will not do anything. Only available for line and area types. |
| unit | string | | v1.0.0 | Override the unit of the sensor |
| float_precision | number | 1 | v1.2.0 | The precision used to display data in the legend and the tooltip. It doesn't impact how the data is displayed on the graph |
| fill_raw | string | 'null' | v1.5.0 | If there is any missing value in the history, last will replace them with the last non-empty state, zero will fill missing values with 0, 'null' will fill missing values with null. This is applied before group_by options |
| group_by | object | | v1.0.0 | See group_by |
| invert | boolean | false | v1.2.0 | Negates the data (1 -> -1). Useful to display opposite values like network in (standard)/out (inverted) |
| transform | string | | v1.5.0 | Transform your raw data in any way you like. See transform |
| data_generator | string | | v1.2.0 | See data_generator |
| statistics | object | | v2.0.0 | Use HA statistical data (long-term). See statistics |
| offset | string | | v1.3.0 | This is different from the main offset parameter. This is at the series level. It is only useful if you want to display data from for eg. yesterday on top of the data from today for the same sensor and compare the data. The time displayed in the tooltip will be wrong as will the x-axis information. Valid values are any negative time string, eg: -1h, -12min, -1d, -1h25, -10sec, ... month (365.25 days / 12) and year (365.25 days) as unit will generate an inconsistent result, you should use days instead. |
| time_delta | string | | v2.0.0 | This applies a time delta to all the data points of your chart after fetching them. You can cumulate it with offset. Valid values are any time strings starting with + or -, eg: -30min, +2h, -2d, ... |
| min | number | 0 | v1.4.0 | Only used when chart_type = radialBar, see chart_type. Used to convert the value into a percentage. Minimum value of the sensor |
| max | number | 100 | v1.4.0 | Only used when chart_type = radialBar, see chart_type. Used to convert the value into a percentage. Maximum value of the sensor |
| color_threshold | object | | v1.6.0 | See experimental |
| yaxis_id | string | | v1.9.0 | The identification name of the y-axis to which this series should be associated. See yaxis |
| `
$ claude mcp add apexcharts-card \
-- python -m otcore.mcp_server <graph>