Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -1072,24 +1072,31 @@ Below is an example YAML configuration that is split into several corresponding
<table>
<tr>
<th>YAML configuration</th>
<th>Preset configurations</th>
</tr>
<tr style="vertical-align:top">
<tr>
<td>

```yaml
hours_to_show: current_day
time_offset: -24h
defaults:
entity:
hovertemplate: "$fn ({ get }) => `%{y:,.1f} ${get('.unit_of_measurement')}<extra>${get('.name')}</extra>`"
hovertemplate: |
$fn ({ get }) => (
`%{y:,.1f} ${get('.unit_of_measurement')}<extra>${get('.name')}</extra>`
)
xaxes:
showspikes: true
spikemode: across
spikethickness: -2
```

</td>
</tr>
<tr>
<th>Preset configurations</th>
</tr>
<tr>
<td>

```js
Expand All @@ -1101,7 +1108,9 @@ window.PlotlyGraphCardPresets = {
simpleHover: { // Start of preset with name 'simpleHover'
defaults: {
entity: {
hovertemplate: ({get}) => `%{y:,.1f} ${get(".unit_of_measurement")}<extra>${get(".name")}</extra>`,
hovertemplate: ({get}) => (
`%{y:,.1f} ${get('.unit_of_measurement')}<extra>${get('.name')}</extra>`
),
},
},
},
Expand Down
Loading