You are reading the development docs (2026.12.1-dev.1): features here may not be released yet.
Skip to content

Styling ​

Colours, lines, fills, markers, the grid, fonts and animation for the whole chart. Charts use your theme's colours and fonts without any style at all, so everything on this page is optional. The legend, axes, labels and reference lines are on Axes and Labels.

For one series' colour and line, the series options (color, stroke_width, curve ...) are usually simpler than the lists below. Colours accept every format in Colours: var(--lcars-*), theme: tokens, computed colours like alpha(), hex and rgba.

Colours ​

style.colors sets the colours of everything on the chart: the series, lines and fills, the background, the text, the grid, the axes and the legend. The lists (series, stroke, fill ...) give one colour per series, in order.

  • Without style.colors the chart uses your theme's chart colours: LCARS orange, blue, yellow and green for the series, grey for the grid.
  • A series' own color wins over style.colors.series for that series.
yaml
type: custom:lcards-chart
chart_type: area
sources:
  - entity: sensor.attic_temperature
    name: Attic
  - entity: sensor.office_temperature
    name: Office
style:
  colors:
    series:
      - var(--lcars-yellow)
      - var(--lcars-violet)
    grid: var(--lcars-gray)
  fill:
    type: gradient
    gradient:
      opacityFrom: 0.5
      opacityTo: 0.05
  legend:
    show: true
KeyTypeDefaultDescription
style.colors.serieslistyour theme's chart coloursSeries colours, used in order
style.colors.strokelistthe series colours (black on polar area, the axis colour on box plots)Line and outline colours
style.colors.filllistthe series coloursArea and column fill colours
style.colors.backgroundcolourtransparentChart background
style.colors.foregroundcolourvar(--lcars-text-light)Default text and label colour
style.colors.gridcolouryour theme's grid colourGrid line colour
style.colors.marker.filllistthe series coloursPoint fill colours
style.colors.marker.strokelistthe foreground colourPoint outline colours
style.colors.axis.xcolouryour theme's axis colourX axis label colour
style.colors.axis.ycolouryour theme's axis colourY axis label colour
style.colors.axis.bordercolourthe grid colourAxis line colour
style.colors.axis.tickscolourthe grid colourTick mark colour
style.colors.legend.defaultcolourthe foreground colourLegend text colour
style.colors.legend.itemslist-Legend text colour for each series, in order
style.colors.data_labelslistthe foreground colourValue label colours

style.stroke ​

style.stroke sets how every line is drawn: its width, its curve and its dashes. It also draws the outline of columns and slices.

yaml
type: custom:lcards-chart
graph_span: 12h
sources:
  - entity: sensor.outdoor_temperature
    name: Outside
style:
  stroke:
    width: 3
    dash_array: 8
    curve: straight
KeyTypeDefaultDescription
style.stroke.widthnumber2Line width, px (0 to 10)
style.stroke.curvestringsmoothsmooth, straight, stepline or monotoneCubic
style.stroke.dash_arraynumber0Dash length, px; 0 is solid (0 to 20)

style.fill ​

style.fill sets how areas and columns are filled: solid, a gradient, or a pattern. A gradient that fades out towards the bottom is the classic look for an area chart.

  • A gradient's opacityFrom and opacityTo fade the fill from the line down to the axis.
yaml
type: custom:lcards-chart
chart_type: area
graph_span: 12h
sources:
  - entity: sensor.outdoor_temperature
    name: Outside
style:
  fill:
    type: gradient
    gradient:
      shade: dark
      type: vertical
      opacityFrom: 0.7
      opacityTo: 0.05
More about fills
  • Pattern and image: pattern draws ApexCharts' default stripes. image needs the image in style.chart_options (fill.image.src).
  • Per series: a series' own opacity wins over style.fill.opacity for that series.
  • Chart types with their own fill: range areas use opacity 0.35 and polar area charts 0.8 unless style.fill.opacity is set.
KeyTypeDefaultDescription
style.fill.typestringsolidsolid, gradient, pattern or image
style.fill.opacitynumber0.7Fill opacity, 0 to 1
style.fill.gradient.shadestring-light or dark
style.fill.gradient.typestring-horizontal, vertical, diagonal1 or diagonal2
style.fill.gradient.shadeIntensitynumber-How strong the shading is, 0 to 1
style.fill.gradient.opacityFromnumber-Opacity where the gradient starts, 0 to 1
style.fill.gradient.opacityTonumber-Opacity where the gradient ends, 0 to 1

style.markers ​

style.markers draws a point on each value. Points are off on line and area charts; they help on a grouped series with few values.

yaml
type: custom:lcards-chart
graph_span: 12h
sources:
  - entity: sensor.outdoor_temperature
    name: Outside
    group_by:
      func: avg
      duration: 1h
style:
  markers:
    size: 6
    shape: diamond
    stroke:
      width: 1
KeyTypeDefaultDescription
style.markers.sizenumber0 (6 on scatter)Point size, px (0 to 20); 0 hides them
style.markers.shapestringcirclecircle, square, rect, diamond, triangle, star, cross, plus or line
style.markers.stroke.widthnumber2 (0 on scatter)Point outline width, px (0 to 10)

style.grid ​

style.grid draws the dashed lines behind the chart, and can shade alternate rows or columns. Its colour is style.colors.grid.

yaml
type: custom:lcards-chart
chart_type: column
sources:
  - entity: sensor.house_power
    name: Power
    group_by:
      func: avg
      duration: 2h
style:
  grid:
    stroke_dash_array: 0
    row_colors:
      - var(--lcars-gray)
      - transparent
KeyTypeDefaultDescription
style.grid.showbooleantrueShow the grid lines
style.grid.stroke_dash_arraynumber4Dash length, px; 0 is solid (0 to 20)
style.grid.row_colorslist-Background colours for alternate rows, repeated in turn
style.grid.column_colorslist-Background colours for alternate columns, repeated in turn

style.typography ​

style.typography sets the font and base size of all the chart's text. Without it the chart uses your theme's LCARS font at 12 px.

  • The legend is 2 px larger than the base size, and reference line labels 2 px smaller.
yaml
type: custom:lcards-chart
sources:
  - entity: sensor.outdoor_temperature
    name: Outside
style:
  typography:
    font_size: 16
KeyTypeDefaultDescription
style.typography.font_familystringyour theme's fontFont for all chart text
style.typography.font_sizenumber12Base font size, px (8 to 24)

style.theme ​

style.theme passes ApexCharts' own theme options: light or dark mode, and a monochrome palette made from shades of one colour. Explicit colours take priority.

  • Monochrome suits a donut or pie of several parts that belong together.
yaml
type: custom:lcards-chart
chart_type: donut
sources:
  - entity: sensor.kitchen_power
    name: Kitchen
  - entity: sensor.office_power
    name: Office
  - entity: sensor.garage_power
    name: Garage
  - entity: sensor.laundry_power
    name: Laundry
style:
  theme:
    monochrome:
      enabled: true
      color: var(--lcars-orange)
      shade_to: dark
KeyTypeDefaultDescription
style.theme.modestringdarkdark or light
style.theme.monochrome.enabledbooleanfalseColour the series in shades of one colour
style.theme.monochrome.colorcolourthe first series colourThe base colour
style.theme.monochrome.shade_tostringdarkdark or light
style.theme.monochrome.shade_intensitynumber0.65How far the shades spread, 0 to 1

Animation ​

style.animation.preset picks how the chart animates in when it first draws, and how it moves when new values arrive. Without a preset charts animate like lcars_standard.

The chart below uses lcars_dramatic; reload the page to see it again.

yaml
type: custom:lcards-chart
chart_type: column
sources:
  - entity: sensor.house_power
    name: Power
    group_by:
      func: avg
      duration: 1h
style:
  animation:
    preset: lcars_dramatic
PresetEntranceUpdates
lcars_standardSmooth, 800 ms, series one after another350 ms
lcars_dramaticSlower and more theatrical, 1200 ms500 ms
lcars_minimalQuick and subtle, 400 ms, all at once200 ms
lcars_realtimeNone100 ms, for live data
lcars_alertFast, 600 ms, for alert displays250 ms
noneNoneNone
KeyTypeDefaultDescription
style.animation.presetstring-One of the presets above

Raw ApexCharts options ​

style.chart_options passes options straight to ApexCharts, for anything LCARdS doesn't cover. It overrides everything else on these pages: see the ApexCharts options reference.

  • Only plain values work here; ApexCharts options that expect JavaScript functions can't be written in YAML.
yaml
type: custom:lcards-chart
chart_type: column
sources:
  - entity: sensor.house_power
    name: Power
    group_by:
      func: avg
      duration: 2h
style:
  chart_options:
    plotOptions:
      bar:
        borderRadius: 6
        columnWidth: 60%
More about raw options
  • Chart type: chart.type here can't switch the chart to a type LCARdS doesn't support; use chart_type.
  • Series data always comes from sources; a series list here is replaced.
  • Colours here can be var(--lcars-*) names and theme: tokens too: they are resolved before ApexCharts sees them.
KeyTypeDefaultDescription
style.chart_optionsobject-ApexCharts options, deep-merged over everything LCARdS sets

Released under the MIT License. | About