Skip to content

Template strings in hover data #3007

Closed
Closed
@chriddyp

Description

@chriddyp

This could include both attributes that exist in the trace

trace.hovertemplate = '{text}<br>{marker.size} Items<br>{y} Dollars'

But also data that is computed on-the-fly by plotly.js, like the bin widths:

trace.hovertemplate = 'The number of people between the age of {binleft} and {binright} is {bintotal}.'

This means you could express the existing box and violin text with some type of hovertemplate

This could span across traces, like the hover data on stacked bars

trace.template = 'This represents {trace.y} out of {data.total}'

Or one day, perhaps even trace level computations, like the sum of the area

texttemplate = 'The sum of the money is {trace.sum}'

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions