ApexChart - Solar production monthly

Hello everyone,

I have created the following chart to show the monthly solar production.
imageimage

Unfortunately, the total for the month is not calculated up to midnight on the last day of the month, but always one day earlier (see screenshots).
This means that the following month also starts earlier and the calculation is “shifted” by around 1.5 days…

Does anyone have an idea how to solve this?

type: custom:apexcharts-card
stacked: true
card_mod:
  style: |
    #state__value > #state {
      font-size: 1.2em !important;
    }
    .apexcharts-tooltip-series-group {
      padding-top: 0px !important;
      padding-bottom: 0px !important;
      margin-top: 0px !important;
      margin-bottom: 0px !important;
      display: none;
      text-align: left;
      justify-content: left;
      align-items: center;
    }
    #header {
        padding: 1rem !important;
    }  
yaxis:
  - id: kwh
    decimals: 0
    min: 0
    max: 50
    apex_config:
      tickAmount: 5
      forceNiceScale: true
      title:
        text: " kWh"
        rotate: -90
      labels:
        style:
          colors: var(--energy-solar-color)
apex_config:
  chart:
    height: 175px
    offsetX: 0
    offsetY: -20
  legend:
    show: false
  dataLabels:
    style:
      fontSize: 0.7rem
    rotate: 90
span:
  end: month
graph_span: 1y
update_interval: 1h
header:
  show: true
  show_states: true
  colorize_states: true
  standard_format: false
all_series_config:
  type: column
  float_precision: 1
  statistics:
    type: sum
    period: day
  group_by:
    func: diff
    start_with_last: false
    duration: 1month
  show:
    in_header: false
    datalabels: true
  opacity: 0.2
  stroke_width: 2
  unit: " kWh"
series:
  - entity: sensor.solarproduktion_gesamt
    yaxis_id: kwh
    name: Solarproduktion
    color: var(--energy-solar-color)
  - entity: sensor.solarproduktion_gesamt
    yaxis_id: kwh
    name: Solarproduktion
    color: var(--energy-solar-color)
    show:
      in_header: raw
      in_chart: false

@ingo.niehues Do you have any ideas? The original code is yours… :wink:

Since the function Start: month also has a shift and does not start exactly at the beginning of the month, I have now posted the error on GitHub:
https://github.com/RomRider/apexcharts-card/issues/870