I display custom apexcharts-card charts, and I found a solution for how to change the width. I wanted it to use the full vertical space of the screen.
It works fine.
Then, I wanted to be able to dynamically modify the chart interval (1h, 1d, etc.), so I use custom:config-template-card.
That also works. Unfortunately, the width is no longer respected; it has become small again.
Have you tried with Card-mod , under the apexcharts-card
“full vertical space” which View are you sing for this “setup”, A single-card Panel-view ?
apex_config:
chart:
height: 312px
width: 100%
or width in px, i don’t know if either will overflow the “config-template-card”, but card-mod should
Next, about a card’s height (which you may not have noticed yet).
The config-template-card does not work nice in Horizontal stack card & Grid card (the latter is used inside sections).
Will be fixed as soon as this PR is merged (there are some things to be done before a next release is created).
Meanwhile, this can be fixed by card-mod.
Play with this:
Height may be customized in apex-charts, of course.
But ANY cards in sections should follow a defined layout - i.e. occupy a provided height (defined by grid options).
When a card is placed into CTC - this breaks.
So => a solution was provided.
Using yaml dashboards only.
Storage dashboards (incl. sections) only for testing, examples etc.
(you know, these storage dashboards can be easily broken if you touch smth inaccurately…)
Thank you all of you for your help. I’m beginner with HA. I started few weeks ago.
I don’t use a Single View Panel because I would like to display multiple charts on the same page. So I thought sections would be the good way.
It works with this config. I had to set the width in config-template-card with section_mode and column 48.
The height is set in apex_config of apexcharts-card.
The config of my dashboard is like this. What shall I use if I want to add multiple charts on the same page ? Temperature, humidity, etc. with full witdh.
yes, both if single card, or 2-3 columns, and upon eachother
Edit: Nope not the height( in the apex-card, the card overwrites/ignore it (just had to make sure, so i set layout height to 200, nothing changed
… Who would set Layout height ?
BTW, the initial idea of placing a graph card inside CTC may be not the best way.
Any card placed in CTC only updates itself when a so called “monitored entity” is updated:
type: config-template-card
entities:
... list of monitored entities
card:
... some inner card reflecting a state of some entity(-ies)
A graph card like apexcharts should update itself automatically when a “graphed” entity is updated. When a graph-card is placed into CTC - it becomes like “isolated” from a system, so you will need to declare a “graphed” entity as “monitored”:
type: config-template-card
entities:
- sensor.xyz # must be declared as "monitored"
card:
type: some-graph-card
... sensor.xyz is used to build a graph
Then the graph card will update itself - but this MAY cause a flickering since the card will be fully redrawn (may also cause a rebuild of a view layout - unless you use it in a Grid card or sections with kind of “predefined cells” for every card).
Means - when a sensor is frequently changing, the card will flicker frequently too.
See my 1st post here, the apexcharts card may be placed in a horiz stack or in sections nearby other cards, they should respect a height of AVAILABLE space provided by a layout.
So, use masonry & enjoy a simpler life)
I Have it perfectly in a huge grid(layout-card), with areas and mediaquery, which adapt to various devices
the others(panel-horizontal-layout) i just tested in, but yes you are right, if i would have put as much effort in these, as i have with my HomeStatus-Grid-Layout, id probably have had “hit the wall”, i only use the CTC for my electricity-prices, and current/coming price levels, which updates per 15min
Nope i never set height in a horizontal-view(layout.card)
I meant, I’ve several charts on the same page (temperature, relative humidity, absolute humidity, etc.). Each chats have ~13 series.
This is why I use a section with grid, I don’t know if there are other ways. I’m a beginner.
I don’t really need an automatic refresh, the purpose of this dashboard isn’t to display it 24/24 on a screen but only on demand.
So I created a sensor now().minute which 5 minutes of increment (0, 5, 10, 15, …) and I added it in entities. CTC refreshes the charts evry 5 minutes, it’s better than no refresh.
I can select dynamically the duration with config-template-card (use 1.3.7-beta.1 instead of 1.3.6, we can define global variables or functions for the dashboard) and I display the charts with apexcharts-card