Skip to content

Pass line styling options through to ChartJS #7312

@AAllport

Description

@AAllport

The request

Add a mechanism to pass ChartJs options to cards such as the Line Graph.
Notably SteppedLine
This will allow people to choose between displaying a Stepped line graph, and a much more pleasing interpolated graph, without having to add unnessasary integrations (for interpolation on the data-side of things)

Ideally, users should be able to set the default for the history component, with the ability to override it on a per sensor basis (via customize)

Feels like adding a key to the Lovelace config to house any raw params to pass straight through to ChartJs could work well
Eg:

type: history-graph
entities:
  - entity: sensor.foo_temp
hours_to_show: 24
refresh_interval: 0
title: Temperatures
chartjs:
  steppedLine: false

The alternatives

As far as I have seen, this is possible with various custom Lovelace cards, however, that seems overkill.

Additional information

Ex: https://www.chartjs.org/docs/latest/charts/line.html#line-styling

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions