ApexCharts card - A highly customizable graph card

How to adjust the bar span only to the right of a data point?

Hourly prices are now off from the data point by a considerable amount (30 min) which is clearly visible in the chart and shows wrong price for half of the time period.

(Couldn’t find a solution with search.)

It’s possible to have a yaml code for this day length chart?

It’s in that post, right below the image.

I copy the code, but no working. For the day length chart only the code posted?

I added the series to my original post, but it won’t work unless you have that sensor or colour variable defined. Override it with your own.

Next time, instead of just saying “not working”, provide the error.

I may have found a bug in apex-charts or something is not quite right. So I have a monthly utility sensor used to capture energy usage from a smart plug. And then I use apex-charts to plot that monthly usage.

But if I use the color option under series, the data from July is not shown in the chart.

I have created a new thread if anyone can shed some light what is happening. Adding a color to the apex chart series removes the previous months data from monthly utility sensor

Hello,

I have this simple electricity market price card, and it has price values for today and updates later also for tomorrows prices, I was able to get that dotted line to show current time, but I don’t find a way to show that value above, instead the number above is always the last number of the array of prices.
Is it possible to define somehow what is the “now” value?

type: custom:apexcharts-card
header:
  show: true
  title: Pörssihinnat
  show_states: true
  colorize_states: true
now:
  show: true
graph_span: 2d
span:
  start: day
series:
  - entity: sensor.shf_electricity_price_now
    type: column
    float_precision: 2
    data_generator: |
      return entity.attributes.data
      .sort((a,b)=>{return a.DateTime-b.DateTime})
      .map((record, index) =>
      {return [record.DateTime, record.PriceWithTax]});
yaxis:
  - decimals: 2

I have a donut chart that reports my daily energy profit and loss. Once is goes it minus it will no longer appear in the donut. Can I change that?

I really have no idea what I’m doing, but here goes nothing! :sweat_smile:

I’ve added a second series to my graph:

  - entity: sensor.nordpool_kwh_se3_sek_3_10_025
    name: 'Now'
    show:
      in_chart: false
      in_header: true
      legend_value: false

… and hidden the first series with:

    show:
      in_header: false

… resulting in something like this:

1 Like

Provide a “label” for “now”: GitHub - RomRider/apexcharts-card: 📈 A Lovelace card to display advanced graphs and charts based on ApexChartsJS for Home Assistant

This worked, thanks

1 Like

Hi, I have a sensor that shows me the electricity consumption of the previous day every day. The sensor changes value every night at 00:30 Is it possible to take this value of the sensor every day at noon to create a graph of monthly consumption?

Question on color_threshold and days shown. My chart looks good for 5 days but as soon as I go to 6days I have a red (high threshold) line showing across the whole range even though it shouldn’t.

5 Day Screenshot

6 Day Screenshot

Graph looks beautiful! do you mind sharing your Neerslag card code? Thank You

With 2023.9 release, weather forecast do not have forecast attributes any longer. Forecast data now are cached and can be retrieved via a service: weather.get_forecast.
I have no idea how to use this service to return data for apex, in my case, to display forecasted temperature in a graph, as well as forecasted rain volume and wind.
Below an example on how to populate a sensor by calling this service. Which I can use to store forecast data in a sensor as its attributes for sure… but this is not elegant nor would take advantage of data being cached. Any idea?

template:
  - trigger:
      - platform: time_pattern
        hours: /1
    action:
      - service: weather.get_forecast
        data:
          type: hourly
        target:
          entity_id: weather.home
        response_variable: hourly
    sensor:
      - name: Weather Forecast Hourly
        unique_id: weather_forecast_hourly
        state: "{{ now().isoformat() }}"
        attributes:
          forecast: "{{ hourly.forecast }}" 

As wrote in my question this not elegant nor taking advantage of caching

hi wanted to share this beautiful radial bar chart I created using ApexCharts documentations Gradient Gauge Chart in React.js – ApexCharts.js

type: custom:apexcharts-card
header:
  show: false
chart_type: radialBar
apex_config:
  plotOptions:
    radialBar:
      startAngle: -135
      endAngle: 225
      hollow:
        margin: 0
        size: 70%
        background: '#fff'
        position: front
        dropShadow:
          enabled: true
          top: 3
          left: 0
          blur: 4
          opacity: 0.24
      dataLabels:
        name:
          offsetY: -25
          show: true
          color: '#888'
          fontSize: 17px
        value:
          color: '#111'
          fontSize: 36px
          show: true
          offsetY: 0
      track:
        background: '#fff'
        strokeWidth: 67%
        margin: 0
        dropShadow:
          enabled: true
          top: -3
          left: 0
          blur: 4
          opacity: 0.35
    background:
      enabled: true
  fill:
    type: gradient
    gradient:
      shadeIntensity: 1
      type: horizontal
      opacityFrom: 1
      opacityTo: 1
      colorStops:
        - offset: 0
          color: '#2adea8'
          opacity: 1
        - offset: 50
          color: '#4e8cd6'
          opacity: 1
  stroke:
    lineCap: round
  legend:
    show: false
series:
  - entity: sensor.bedroom_climate_humidity
    name: Humidity

fc3noor2


official vs mine

10 Likes

The sensor code only showed half of it (browser issue with me). If you followed the large poll on keeping fc then you see plenty of people wanting to keep it. The technical reasons may all be valid but the end-user (,e/us) are stuck with card that are not up-to-date and apex/plotly that have no solution …and these highly will never have a solution as this is very sensor-specific.I am not sure why you would need / want cached data…I only need access to the data, dot-end, care to elaborate why cache is important to you?

If you have a smart technical solution or an evidence that service/cache cannot be retrieved please share it. We can discuss but personal opinion on breaking change due to 2023.9 is not what I am looking for :wink:

I have none and again, I donot see any need for it neither are you presenting a reason for needing cached data…why make it complex if the solution is ‘simple’