New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataLabels formatter not working | Highcharts Sankey Diagram #7284

Closed
junaidpkhader opened this Issue Oct 17, 2017 · 4 comments

Comments

Projects
None yet
2 participants
@junaidpkhader

junaidpkhader commented Oct 17, 2017

Expected Behaviour

Ability to format the dataLabel in the sankey diagram

Actual Behaviour

dataLabel is not getting formatted.

Live demo with steps to reproduce

http://jsfiddle.net/jy0761aw/2/

Affected browser(s)

All browsers

@pawelfus

This comment has been minimized.

Show comment
Hide comment
@pawelfus

pawelfus Oct 17, 2017

Contributor

Hi @junaidpkhader

Thanks! I'm not sure if formatter is supported in Sankey diagram and buggy or it's a bug in the docs, @TorsteinHonsi ?

According to the docs:

Options for the data labels appearing on top of the nodes and links. For sankey charts, data labels are visible for the nodes by default, but hidden for links. This is controlled by modifying the nodeFormat, and the format that applies to links and is an empty string by default.

And nodeFormat docs:

nodeFormat: String
The format string specifying what to show for nodes in the sankey diagram.

Defaults to {point.name}.

Contributor

pawelfus commented Oct 17, 2017

Hi @junaidpkhader

Thanks! I'm not sure if formatter is supported in Sankey diagram and buggy or it's a bug in the docs, @TorsteinHonsi ?

According to the docs:

Options for the data labels appearing on top of the nodes and links. For sankey charts, data labels are visible for the nodes by default, but hidden for links. This is controlled by modifying the nodeFormat, and the format that applies to links and is an empty string by default.

And nodeFormat docs:

nodeFormat: String
The format string specifying what to show for nodes in the sankey diagram.

Defaults to {point.name}.

@junaidpkhader

This comment has been minimized.

Show comment
Hide comment
@junaidpkhader

junaidpkhader Oct 17, 2017

Thanks for the reply @pawelfus . Yes, I tried the nodeFormat as well. (The thing is I am unable to even write a ternary function in the nodeFormat).

Is there any way to call a function(similar to that in the formatter) in nodeFormat? (I was only able to give a string [eg. {point.name}]). We wanted to trim last part of the datalabel based on a condition.

As you might have already seen in the jsfiddle, in the sankey diagram, we are unable to show the change from the same stage. (In the fiddle, to override that we gave Contact to Contact1) [And I need to trim the "1" from Contact1 so that we can show the diagram as I just told before.]
Thank you.

junaidpkhader commented Oct 17, 2017

Thanks for the reply @pawelfus . Yes, I tried the nodeFormat as well. (The thing is I am unable to even write a ternary function in the nodeFormat).

Is there any way to call a function(similar to that in the formatter) in nodeFormat? (I was only able to give a string [eg. {point.name}]). We wanted to trim last part of the datalabel based on a condition.

As you might have already seen in the jsfiddle, in the sankey diagram, we are unable to show the change from the same stage. (In the fiddle, to override that we gave Contact to Contact1) [And I need to trim the "1" from Contact1 so that we can show the diagram as I just told before.]
Thank you.

@pawelfus

This comment has been minimized.

Show comment
Hide comment
@pawelfus

pawelfus Oct 18, 2017

Contributor

I agree, something like nodeFormatter() would be great here. Thank you for the details!

Contributor

pawelfus commented Oct 18, 2017

I agree, something like nodeFormatter() would be great here. Thank you for the details!

@junaidpkhader

This comment has been minimized.

Show comment
Hide comment
@junaidpkhader

junaidpkhader Oct 19, 2017

Yes @pawelfus . Hope something like that would come soon.
@TorsteinHonsi

junaidpkhader commented Oct 19, 2017

Yes @pawelfus . Hope something like that would come soon.
@TorsteinHonsi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment