Help with Apex chart card for body stats?

I am working on an apex chart card to display body stat info, but I cannot seem to get it quite right. Basically, I am wanting to stack the values to equal a total weight and display that info as such on the chart. Below is what i have so far… as you can see the values are displayed, but they should be in addition to the previous value… so 0+8.4+50.2+161 NOT 0-8.4 then 0-50.2 then 0-161, etc.

I still would like to display the total weight value in the header, but it would not be required on the chart as all the other values would equal the total weight.

2023-12-30 08_34_34-Andrew Dashboard – Home Assistant - Vivaldi

Any help is appreciated

type: custom:apexcharts-card
graph_span: 7d
span:
  end: day
  offset: '-1sec'
header:
  show: true
  title: Andrew's Body Stats
  show_states: true
  colorize_states: true
all_series_config:
  stroke_width: 0
  type: line
color_list:
  - green
  - blue
  - orange
  - yellow
series:
  - entity: sensor.andrew_withings_weight
    name: Total Weight
    type: area
    group_by:
      func: last
      duration: 24h
  - entity: sensor.andrew_withings_muscle_mass
    name: Muscle Mass
    type: area
    group_by:
      func: last
      duration: 24h
  - entity: sensor.andrew_withings_fat_mass
    name: Fat Mass
    type: area
    group_by:
      func: last
      duration: 24h
  - entity: sensor.andrew_withings_bone_mass
    name: Bone Mass
    type: area
    group_by:
      func: last
      duration: 24h
apex_config:
  cache: true
  tickAmount: 10
  dataLabels:
    enabled: true
    dropShadow:
      enabled: true
  chart:
    zoom:
      enabled: true
    toolbar:
      show: true
      tools:
        zoom: true
        zoomin: true
        zoomout: true
        pan: true
        reset: true
    fill:
      type: gradient
      gradient:
        shadeIntensity: 0.1
        opacityFrom: 0.25
        opacityTo: 1
        inverseColors: true
        stops:
          - 0
          - 70
          - 100

as per usual, I figured this out on my own without any help from the community. Here is an updated version of the card if anyone else runs into the same issue with sensor and entity names omitted.

As you can see in the card I have stacked the data points in a way that would be a total body composition
white = skeleton
red = muscle
goldenrod = fat

obviously, the goal would be to reduce fat composition and there should not be too much fluctuations in the skeleton weight.

I hope this helps someone else in the future. I realize that this is health information and should be treated with sensitivity; however, my thought is that this is for educational purposes.

2024-01-01 11_49_31-Andrew Dashboard – Home Assistant - Vivaldi

type: custom:apexcharts-card
graph_span: 7d
stacked: true
span:
  end: day
  offset: '-1sec'
header:
  show: true
  title:  Body Stats
  show_states: true
  colorize_states: true
all_series_config:
  stroke_width: 0
  type: area
color_list:
  - green
  - white
  - crimson
  - darkgoldenrod
series:
  - entity: sensor.
    name: Total Weight
    type: area
    show:
      in_chart: false
    group_by:
      func: last
      duration: 24h
  - entity: sensor.
    name: Bone Mass
    type: area
  - entity: sensor.
    name: Muscle Mass
    type: area
  - entity: sensor.
    name: Fat Mass
    type: area
apex_config:
  cache: true
  tickAmount: 10
  dataLabels:
    enabled: true
    dropShadow:
      enabled: true
  chart:
    zoom:
      enabled: true
    toolbar:
      show: true
      tools:
        zoom: true
        zoomin: true
        zoomout: true
        pan: true
        reset: true
    fill:
      type: gradient
      gradient:
        shadeIntensity: 0.1
        opacityFrom: 0.25
        opacityTo: 1
        inverseColors: true
        stops:
          - 0
          - 70
          - 100

1 Like

Thank you, this is exactly what I need :slight_smile:
At the moment I have fat % and not mass. I need somehow get the mass but I think it’s will be total weight - fat%