kalkih / mini-graph-card

Minimalistic graph card for Home Assistant Lovelace UI
MIT License
2.99k stars 233 forks source link

align_icon to right is not applied #1078

Closed SAOPP closed 7 months ago

SAOPP commented 7 months ago

Hey!

I tried to show my icons to the right corner, but this is not working for me. Any suggestion? Thanks!

image

        - type: custom:mini-graph-card
          entities:
            - entity: sensor.toilet_monitor_temperature
              name: Температура
              color: '#03A9F4'
          hours_to_show: 24
          line_width: 4
          decimals: 1
          align_icon: right
          animate: true
          height: 90
          font_size: 65
          show:
            name: false
            icon: true
            state: false
            legend: false
            fill: fade
          card_mod:
            style: |
              ha-card {
                border-radius: 8px;
                background: none;
                box-shadow: none;
                --ha-card-border-width: 0;
              }
        - type: custom:mini-graph-card
          entities:
            - entity: sensor.toilet_monitor_humidity
              name: Влажность
              color: '#B694E7'
          hours_to_show: 24
          line_width: 4
          decimals: 1
          align_icon: right
          animate: true
          height: 90
          font_size: 65
          show:
            name: false
            icon: true
            state: false
            legend: false
            fill: fade
          card_mod:
            style: |
              ha-card {
                border-radius: 8px;
                background: none;
                box-shadow: none;
                --ha-card-border-width: 0;
              }
ildar170975 commented 7 months ago
  1. Why the code & screenshot contain lots of unrelated things like card-mod, other UI elements? This should not be posted. Just a distraction & waste of space.
  2. The align_icon: right option works only if name is shown (this is a "flex" row). If you do not want to show name - just set it to name: ' '. In your code you have name: Температура and name: false which has no sense.
Nickduino commented 5 days ago

2. The align_icon: right option works only if name is shown (this is a "flex" row). If you do not want to show name - just set it to name: ' '.

I don't get the reasoning but ok. Could you update the doc, then?

image to something like "Set the alignment of the icon, left, right or center, only if the name is displayed." (I imagine it's center and not state but I may have gotten that wrong.

Moreover, I thing the icon alignment should default to right even when there is no name (because it's there for 99% of the other graphs anyway)