A Sparkline normally draws one history series, but it can show several series inside the same graph area. Each series can use another entity, name, color, chart appearance, period, or one of the two Y-axis - primary or secondary - while sharing the overall Sparkline.
This page shows how to add multiple series, style and name them, show a legend, give a series its own period, and use a secondary Y-axis when needed.
entities:-entity:sensor.living_room_temperature# Home Assistant entity used by this card-entity:sensor.bedroom_temperature# Home Assistant entity used by this cardlayout:sparklines:-id:room-history# Name this item so it can be referenced laterxpos:50# Horizontal position; 50 = center of the cardypos:50# Vertical position; 50 = center of the cardwidth:88# Width of the graphheight:42# Height of the graphperiod:type:rolling_window# Always show the latest moving time rangerolling_window:duration:hour:24# Show 24 hours of historybins:per_hour:auto# Let the card choose a readable time interval automaticallydensity:medium# Choose low, medium, or high detail when intervals are automaticseries:-id:living-room# Name this series inside the graphentity_index:0# Use the first entity configured abovename:Living room# Name shown to the usercolor:"#42a5f5"sparkline:show:chart_type:line# Draw the history as a connected line-id:bedroom# Name this series inside the graphentity_index:1# Use the second entity configured abovename:Bedroom# Name shown to the usercolor:"#f9a825"sparkline:show:chart_type:line# Draw the history as a connected line
The parent Sparkline supplies the shared period, axes, grid, and drawing area. Each series chooses its own entity and can override supported graph settings.
entities:-entity:sensor.temperature# First graph series-entity:sensor.humidity# Second graph serieslayout:sparklines:-xpos:50# Horizontal center of the graphypos:50# Vertical center of the graphwidth:80# Graph width in card coordinatesheight:35# Graph height in card coordinatesseries:-id:temperature# Name this series inside the graphentity_index:0# Use entity 0 from entities: (0 = first entity)name:Temperature# Name shown to the usercolor:"#42a5f5"sparkline:show:chart_type:line# Draw the history as a connected line-id:humidity# Name this series inside the graphentity_index:1# Use entity 1 from entities: (0 = first entity)name:Humidity# Name shown to the usercolor:"#66bb6a"sparkline:show:chart_type:dots# Draw one point for each time intervaldots:radius:0.75# Size of each point
entities:-entity:sensor.temperature# First graph series-entity:sensor.humidity# Second graph serieslayout:sparklines:-xpos:50# Horizontal center of the graphypos:50# Vertical center of the graphwidth:80# Graph width in card coordinatesheight:35# Graph height in card coordinatesseries:-id:temperatureentity_index:0-id:humidityentity_index:1sparkline:show:legend:true# Show a legend for the configured serieslegend:position:top# Place this element at the toprows:1gap:4# Space between these visible partsitem_gap:2
Without a custom name, the card builds the label from the Home Assistant area/entity information.
A series can override the offset inside the parent's active calendar or rolling-window period. It does not replace the parent period type, duration, or bin settings. This example shows today and yesterday on the same time-of-day axis:
entities:-entity:sensor.temperature# First graph series-entity:sensor.humidity# Second graph serieslayout:sparklines:-xpos:50# Horizontal center of the graphypos:50# Vertical center of the graphwidth:80# Graph width in card coordinatesheight:35# Graph height in card coordinatesperiod:type:calendar# Follow a calendar period such as today or yesterdaycalendar:period:day# Use one calendar day as the periodoffset:0# Use the current calendar periodduration:hour:24# Show 24 hours of historybins:per_hour:2# Use 2 displayed interval(s) per hourseries:-id:today# Name this series inside the graphentity_index:0# Use entity 0 from entities: (0 = first entity)name:Today# Name shown to the user-id:yesterday# Name this series inside the graphentity_index:0# Use entity 0 from entities: (0 = first entity)name:Yesterday# Name shown to the userperiod:calendar:offset:-1# Move back 1 calendar period(s); -1 = previous period
entities:-entity:sensor.temperature# First graph series-entity:sensor.humidity# Second graph serieslayout:sparklines:-xpos:50# Horizontal center of the graphypos:50# Vertical center of the graphwidth:80# Graph width in card coordinatesheight:35# Graph height in card coordinatesseries:-id:cpu# Name this series inside the graphentity_index:0# Use entity 0 from entities: (0 = first entity)sparkline:show:chart_type:line# Draw the history as a connected lineline:show:minmax:true# Show the minimum-to-maximum range for each interval
entities:-entity:sensor.temperature# First graph series-entity:sensor.humidity# Second graph serieslayout:sparklines:-xpos:50# Horizontal center of the graphypos:50# Vertical center of the graphwidth:80# Graph width in card coordinatesheight:35# Graph height in card coordinatesseries:-id:temperature# Name this series inside the graphentity_index:0# Use entity 0 from entities: (0 = first entity)y_axis_id:primary# Use the primary Y-axis for this series-id:humidity# Name this series inside the graphentity_index:1# Use entity 1 from entities: (0 = first entity)y_axis_id:secondary# Use the secondary Y-axis for this series
Inside series[].sparkline.show.chart_type, an explicit series can use line, area, dots, bar, or radial. Other parent chart families are not valid as per-series chart types. A radial series can use line, area, or dots as its chart_variant.
Required applies to the specific form described by that table: Yes means you need the field for that form; No means you can leave it out. Not set means the card adds no explicit value when the option is omitted.
Option
Type
Required
Default
Description
series[].id
string
Yes
—
Unique series name inside the graph.
series[].entity_index
entity index
Yes
—
Entity whose history is shown.
series[].name
string/structured name
No
Area/entity name
Label used by legend/tooltip.
series[].color
color
No
Automatic palette
Fixed series color.
series[].sparkline
mapping
No
Shared graph settings
Per-series chart settings.
series[].period
mapping
No
Shared period
Overrides only offset inside the parent-selected calendar or rolling_window branch; period type, duration, and bins stay shared.
series[].y_axis_id
primary, secondary
No
primary
primary uses the main Y-axis; secondary uses the second Y-axis.
sparkline.show.legend
boolean
No
false
Shows the legend.
sparkline.legend.position
top, bottom, left, right
No
top
top and bottom place the legend in horizontal rows above/below the graph; left and right place it in a vertical column beside the graph.