dbuezas / lovelace-plotly-graph-card

Highly customisable Lovelace card to plot interactive graphs. Brings scrolling, zooming, and much more!
365 stars 16 forks source link

Title and Legend Overlapping #76

Closed brennanmuir closed 1 year ago

brennanmuir commented 1 year ago
image
Bascht74 commented 1 year ago

same here: image

type: custom:plotly-graph
entities:
  - entity: number.eg_andrea_arbeitsraum_rechts_level
    name: Andrea
  - entity: number.eg_studio_klein_level
    name: Studio klein
  - entity: number.eg_studio_gross_level
    name: Studio groß
  - entity: number.eg_laden_theke_level
    name: Laden
  - entity: sensor.eg_martina_durchfluss
    name: Martina
title: Heizung EG
layout:
  height: 330
hours_to_show: 24
Bascht74 commented 1 year ago

I just tried to add "pad" to layout->title but I have not figurered out how to use it. It would be great that if you use the default layout of your card, the padidng wil be added automatically it you use a title for the card.

dbuezas commented 1 year ago

The solution is

layout:
  margin:
    t: 70

But so many people have the same problem, that I just made it so that the extra margin is added automatically if there is a title.

Bascht74 commented 1 year ago

could you donate some more pixels?

Right now it is still very narrow: image

75 as standard would be better: image

dbuezas commented 1 year ago

Hey @Bascht74 I think that's because you have a taller card, and in plotly the title is vertically positioned in percentage of height. Can you temporarily disable your height override and confirm? I may need to compute the top margin dynamically

dbuezas commented 1 year ago

Thanks for your PR unfortunately, it looks like I need to rework how titles and legends are positioned to avoid these overlapping issues completely

Bascht74 commented 1 year ago

you are right:

200px image

300px image

400px image

500px image

So it seems more like the position of the legend that needs to be calculated...

dbuezas commented 1 year ago

You are right

dbuezas commented 1 year ago

Try v1.4.7 and let me know if it is anything but perfect now 😎