d3-indented-tree API example #18
This example demonstrates how to customize link labels and locale formatting in a d3-indented-tree chart. It shows a tree where each link’s label displays the `weight` column’s value in Euros, using a custom German locale with comma decimals and period thousands separators. The code calls `myChart.linkLabel("weight", {unit: " Euro", onTop: true, format: ",.2f"})` to set the label text and formatting, while `myChart.formatDefaultLocale(localeGerman)` applies the locale to number display. The data is embedded in an aside element and parsed by d3-indented-tree, with `propagateValue("size")` sizing nodes and `linkWidth(100)` fixing link thickness.
AI-generated descriptionAPI examples for d3-indented-tree
myChart.linkLabel() - 3, myChart.formatDefaultLocale()
This example shows how to set the link label based on the column weight, displaying its values with the string "Euro". The locale is set by myChart.formatDefaultLocale().
- for documentation, go to https://github.com/EE2dev/d3-indented-tree
- for other examples, go to https://github.com/EE2dev/d3-indented-tree#examples
Acknowledgements: