Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CDD-2140: Update plotly hover template date format
Browse files Browse the repository at this point in the history
phill-stanley committed Jan 17, 2025
1 parent d6ca0c1 commit 7aeb46f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion metrics/interfaces/charts/access.py
Original file line number Diff line number Diff line change
@@ -92,8 +92,17 @@ def _apply_hover_label_styling(self):
)

def _apply_hover_template_to_all_plots(self):
"""
Note:
the plots hovertemplate property is used by plotly react
on the front-end to control hover text formatting.
To format dates using the hovertemplate you can use
`D3-time-format` specifiers. examples can be found at:
https://d3js.org/d3-time-format
"""
for plot in self.figure.data:
plot.hovertemplate = "%{y} <extra></extra>"
plot.hovertemplate = "%{y} (%{x|%d %b %Y})<extra></extra>"

def _disable_clicks_on_legend(self):
self.figure.layout.legend.itemclick = False

0 comments on commit 7aeb46f

Please sign in to comment.