bar-card icon indicating copy to clipboard operation
bar-card copied to clipboard

Barchart bars are not the same width.

Open zibous opened this issue 5 years ago • 5 comments

Installed: BAR-CARD Version 3.1.6

Bildschirmfoto 2020-05-03 um 15 08 22

type: "custom:vertical-stack-in-card"
title: Verbrauch Erdgeschoss
cards:

  - type: "custom:bar-card"
    columns: 7
    stack: horizontal
    direction: up
    entities:
      - entity: sensor.verbrauch_buro
        name: 'Büroraum'
      - entity: sensor.verbrauch_waschraum
        name: 'Wirtschaftraum'
      - entity: sensor.verbrauch_heizung
        name: 'Heizungsraum'
      - entity: sensor.verbrauch_vorratsraum
        name: 'Vorratsraum'
      - entity: sensor.verbrauch_gang_eg
        name: 'Vorraum'
      - entity: sensor.verbrauch_garage
        name: 'Garage'
      - entity: sensor.verbrauch_zahlerschrank
        name: 'Zählerschrank'
    positions:
      icon: 'off'
      indicator: inside
      name: outside
    height: 240px
    max: 3500
    min: 0
    padding: 2px
    title_position: inside
    unit_of_measurement: Wh
    width: 100%
    line_width: 0.5
    title_style:
      font-size: 14px
      font-weight: 400
    value_style:
      font-size: 14px
      font-weight: 500
    severity:
      - color: "#CFD8DC"
        value: 0
      - color: "#4CAF50"
        value: 50
      - color: "#FDD835"
        value: 100
      - color: "#64DD17"
        value: 200
      - color: "#FFF176"
        value: 300
      - color: "#FFEB3B"
        value: 400
      - color: "#FF5722"
        value: 600
      - color: "#f44336"
        value: 800
      - color: "#f44336"
        value: 5000
    style: |
      ha-card {
        border-radius: 4px;
        transform: scale(0.95);
        background-size: 100% 100%;
        background-color: transparent;
      }
     ....

name: inside --> same barwidth but name text to long ? Bildschirmfoto 2020-05-03 um 15 28 21

QAD-Setting with CSS:

    style: |-
      ha-card {
        border-radius: 4px;
        transform: scale(0.95);
        background-size: 100% 100%;
        background-color: transparent;
      }
      bar-card-name {
       text-overflow: ellipsis;
       white-space: nowrap;
       overflow: hidden;
       width:100%;
       cursor: pointer ! important;
      }
      bar-card-card	{
        min-width:10%;  
      }

Do I have to change anything in the settings?

zibous avatar May 03 '20 13:05 zibous

Your last CSS example actually works fine for me. image

Just to be sure do you have card-mod installed and working correctly?

Gluwc avatar May 05 '20 13:05 Gluwc

@Gluwc Yes it works, but only with CSS (and card-mod installed).

Bildschirmfoto 2020-05-05 um 15 31 30

zibous avatar May 05 '20 13:05 zibous

Ah right I thought you meant it didn't work at all. I'll see if I can do anything about this to make it default behavior, however I'm not sure since I might have to add a load of exceptions. Good to see you at least got it working for now.

Gluwc avatar May 05 '20 13:05 Gluwc

I think this is a similar issue. I was about to ask if the name field could be shortened to the chart width with ellipses (like the button card below) to prevent it pushing the bar charts off the card:

IMG_0564

Rather than the bar chart assuming the width of the name.

tomlut avatar May 09 '20 20:05 tomlut

Would it help if we were able to specify the column width as a percentage of the card width rather than a number that seems to calculate an absolute width in px?

tomlut avatar May 12 '20 10:05 tomlut