Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apexcharts example in Readme? #7

Open
cortado opened this issue May 29, 2023 · 1 comment
Open

Apexcharts example in Readme? #7

cortado opened this issue May 29, 2023 · 1 comment

Comments

@cortado
Copy link

cortado commented May 29, 2023

Really useful HA integration - possible to provide the Apexchart code for your example in the Readme?

@tmjo
Copy link
Owner

tmjo commented Jun 1, 2023

Hi,

Here's an example:

type: custom:apexcharts-card
graph_span: 36h
span:
  offset: +24h
now:
  show: true
  label: Now
header:
  show: true
  title: Tidewater
  show_states: true
series:
  - entity: sensor.YOURPLACE_tide_main
    name: Prediction
    show:
      extremas: time
      in_header: before_now
      legend_value: false
    data_generator: |
      return entity.attributes.data.map((entry) => {
        return [new Date(entry.datetime).getTime(), entry.prediction];
      });
  - entity: sensor.YOURPLACE_tide_main
    name: Forecast
    show:
      in_header: before_now
      legend_value: false
    data_generator: |
      return entity.attributes.data.map((entry) => {
        return [new Date(entry.datetime).getTime(), entry.forecast];
      });
  - entity: sensor.YOURPLACE_tide_main
    name: Observation
    show:
      in_header: before_now
      legend_value: false
    data_generator: |
      return entity.attributes.data.map((entry) => {
        return [new Date(entry.datetime).getTime(), entry.observation];
      });

Will look something like this:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants