Skip to content

Commit 1cc2e21

Browse files
committed
Change default tooltip and show_value default template to 2 decimal digits
1 parent 2ed0f0a commit 1cc2e21

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/plotly-graph-card.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ export class PlotlyGraph extends HTMLElement {
398398
mergedTrace.legendgroup ??= "group" + traceIdx;
399399
show_value_traces.push({
400400
// @ts-expect-error (texttemplate missing in plotly typings)
401-
texttemplate: `%{y}%{customdata.unit_of_measurement}`, // here so it can be overwritten
401+
texttemplate: `%{y:.2~f}%{customdata.unit_of_measurement}`, // here so it can be overwritten
402402
...mergedTrace,
403403
mode: "text+markers",
404404
showlegend: false,

0 commit comments

Comments
 (0)