Plotly.js: Axis title could also change the labels in the hovering popup

Created on 7 May 2018  路  8Comments  路  Source: plotly/plotly.js

This is an enhancement suggestion.

When setting the title of an axis, such as:

        xaxis: {
            type: 'linear',
            zeroline: false,
            title: "hellox"  // <----
        },

it would make sense to have the same title as default value in the popup being shown on mouse hovering. Currently, the default value stays "x", where it could have been "hellox" instead.

See an example here: https://codepen.io/anon/pen/qoGQvx

See also the riginal question asked on Stack Overflow

Please, let me know if that makes sense.

feature

Most helpful comment

I think this makes a ton of sense in general and especially in 3d and ternary contexts: 3d because after a few rotations or whatever, it's no longer visually clear what x, y, and z mean, and ternary because there's no reasonable way a user could know what A, B and C map to ;)

All 8 comments

Thanks @adube - yes, makes a lot of sense. I don't think we can always do this, there are times when the title is too long, or displayed on one subplot and not others, etc... so it would probably have to be opt-in unless we can come up with a sufficiently robust criterion for automatically using the title.

@alexcjohnson Thanks for your comment.

I agree. As a way to not _always_ enable this behaviour, we could have some sort of "flag" option (boolean) which would be false by default to not break the current behaviour. When setting it to true, users could expect limitations such as title being too long and the other things you mentioned.

I'm not familiar enough with the code to be able to determine a more robust solution at this point, but I think the above suggestion could do the trick.

I think this makes a ton of sense in general and especially in 3d and ternary contexts: 3d because after a few rotations or whatever, it's no longer visually clear what x, y, and z mean, and ternary because there's no reasonable way a user could know what A, B and C map to ;)

Indeed, it is.

I agree. As a way to not _always_ enable this behaviour, we could have some sort of "flag" option (boolean) which would be false by default to not break the current behaviour. When setting it to true, users could expect limitations such as title being too long

This option (e.g., 'hovertitle') may also contain text (for each axis) as alternative short hover-only title for this axis. That is, default 'false' value means current behaviour, 'true' means use axis label (maybe with some automatic abbreviation), and text value means use this value.
Would be great if the text may also contain HTML and TeX markup, even in 3D plots (seems like it may be simpler to implement than #608 )

Seems like similar feature was already implemented (but not pulled yet): #3126 #3007

@antoinerg this would be a nice addition :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

boleslawmaliszewski picture boleslawmaliszewski  路  3Comments

tim-sauchuk picture tim-sauchuk  路  3Comments

n-riesco picture n-riesco  路  3Comments

HunterMcGushion picture HunterMcGushion  路  3Comments

danielsamuels picture danielsamuels  路  3Comments