Skip to content
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 · 5 comments
Closed

DataLabels formatter not working | Highcharts Sankey Diagram #7284

junaidpkhader opened this issue Oct 17, 2017 · 5 comments

Comments

@junaidpkhader
Copy link

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
Copy link
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
Copy link
Author

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
Copy link
Contributor

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

@junaidpkhader
Copy link
Author

junaidpkhader commented Oct 19, 2017

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

@nodew
Copy link

nodew commented Oct 11, 2019

Please help update the doc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants