Use Icons as Scatter Point Text #481
-
Hi, is there a way to use icons (Home assistant, fontawsome or google icon font https://fonts.google.com/icons? ) as the text of the scatter points ?
but i dont see the icon. Would be nice if someone had a solution. As i said also the default home assistant icon would be sufficiant. BR |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 3 replies
-
I don't think it is possible. The closest thing is using emojis. Just copy and paste them from e.g https://emojipedia.org/ |
Beta Was this translation helpful? Give feedback.
-
Thanks for the quick reply. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
It is working now. There are several options you can use and i think none of them is really obvious 😄 After i figured this out, I added a new attribute to my sensor which held a list of image objects with the calculated percentage value for the x positioning and static y value. Again thanks for your time and support. BR |
Beta Was this translation helpful? Give feedback.
-
Hi, i made some more tweaks. type: custom:plotly-graph
refresh_interval: 20
hours_to_show: 11
period: hour
autorange_after_scroll: false
title: null
view_layout:
grid-area: chart
config:
scrollzoom: false
autoScale: true
disablePinchToZoom: false
displayModeBar: false
staticPlot: false
layout:
height: 250
xaxis:
dragmode: false
type: date
fixedrange: true
dtick: 14400000
tickformat: |
%H:%M
%d.%m.%Y
range:
- >-
$ex
hass.states['sensor.my_ev_price_display_tibber_sensor'].attributes.all_prices[4]['time']
- >-
$ex
hass.states['sensor.my_ev_price_display_tibber_sensor'].attributes.all_prices.at(-1)['time']
yaxis:
dtick: >-
$ex
hass.states['sensor.my_ev_price_display_tibber_sensor'].attributes.yscaleStep
range:
- >-
$ex
(hass.states['sensor.my_ev_price_display_tibber_sensor'].attributes.yscaleMin
- 5)
- >-
$ex
(hass.states['sensor.my_ev_price_display_tibber_sensor'].attributes.yscaleMax
+
hass.states['sensor.my_ev_price_display_tibber_sensor'].attributes.yscaleStep)
fixedrange: true
round: 2
images: |-
$ex
hass.states['sensor.my_ev_price_display_tibber_sensor'].attributes.charging_marker
entities:
- entity: sensor.my_ev_price_display_tibber_sensor
name: Strompreis
yaxis: y1
showlegend: false
fill: tonext
mode: lines
fillcolor: rgba(255,165,0,.15)
line:
color: orange
width: 2
filters:
- store_var: my_ev_price_tibber_sensor
- fn: |-
({ meta, vars }) => ({
xs: [vars.my_ev_price_tibber_sensor.xs.slice(-1)[0],...meta.greater_avg.map(({ time }) => new Date(time))],
ys: [vars.my_ev_price_tibber_sensor.ys.slice(-1)[0],...meta.greater_avg.map(({ price }) => price)],
})
- entity: sensor.my_ev_price_display_tibber_sensor
name: Strompreis
yaxis: y1
showlegend: false
fill: tozeroy
fillgradient:
stop: >-
$ex
hass.states['sensor.my_ev_price_display_tibber_sensor'].attributes.avg_price
start: 0
colorscale:
- - 0
- rgba(0, 0, 0, 0.0);
- - 1
- rgba(3, 143, 46,0.25)
type: vertical
type: scatter
mode: none
filters:
- store_var: my_ev_price_tibber_sensor
- fn: |-
({ meta, vars }) => ({
xs: [vars.my_ev_price_tibber_sensor.xs.slice(-1)[0],...meta.smaller_avg.map(({ time }) => new Date(time))],
ys: [vars.my_ev_price_tibber_sensor.ys.slice(-1)[0],...meta.smaller_avg.map(({ price }) => price == null ? meta.avg_price : price )],
})
- entity: sensor.my_ev_price_display_tibber_sensor
name: Strompreis
yaxis: y1
showlegend: false
fill: none
fillcolor: rgba(3, 143, 46,.1)
type: scatter
mode: lines
line:
color: rgba(3, 143, 46, 1)
width: 2
filters:
- store_var: my_ev_price_tibber_sensor
- fn: |-
({ meta, vars }) => ({
xs: [vars.my_ev_price_tibber_sensor.xs.slice(-1)[0],...meta.smaller_avg.map(({ time }) => new Date(time))],
ys: [vars.my_ev_price_tibber_sensor.ys.slice(-1)[0],...meta.smaller_avg.map(({ price }) => price)],
})
- entity: sensor.my_ev_price_display_tibber_sensor
name: Ladezeit
yaxis: y1
showlegend: false
fill: tozeroy
fillcolor: rgba(173, 216, 230,0.15)
line:
color: transparent
width: 0
filters:
- store_var: my_ev_price_tibber_sensor
- fn: |-
({ meta, vars }) => ({
xs: [vars.my_ev_price_tibber_sensor.xs.slice(-1)[0],...meta.charging_plan.map(({ time }) => new Date(time))],
ys: [vars.my_ev_price_tibber_sensor.ys.slice(-1)[0],...meta.charging_plan.map(({ price }) => price > 0 ? 4000:0)],
})
- entity: sensor.my_ev_price_display_tibber_sensor
name: Now
yaxis: y1
showlegend: false
line:
width: 2
dash: dot
color: deepskyblue
x: $fn () => [Date.now(), Date.now()]
'y':
- 0
- 4000 The sensor for the image(s) returns something like this: charging_marker:
- source: /local/images/car-electric-outline.svg
x: 0.42
'y': 0.15
xanchor: center
yanchor: middle
sizex: 0.15
sizey: 0.15
layer: above BR |
Beta Was this translation helpful? Give feedback.
I don't think it is possible. The closest thing is using emojis. Just copy and paste them from e.g https://emojipedia.org/