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

Span "month" don´t start or ends exactly on month #870

Open
Neewieedo opened this issue Feb 16, 2025 · 1 comment
Open

Span "month" don´t start or ends exactly on month #870

Neewieedo opened this issue Feb 16, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@Neewieedo
Copy link

Neewieedo commented Feb 16, 2025

Hello everyone,

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

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

But since it is not a static error, so span offset don't helps :-(

Image

Image

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
@Neewieedo Neewieedo added the bug Something isn't working label Feb 16, 2025
@henriknordgren
Copy link

Yes I noticed that too. I get one or two days extra for the previous month. I hope this gets fixed...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants