Skip to main content
100%

d3-indented-tree API example #18

✓ Published0🌍 Public
EEE2dev
Last edited Dec 30, 2020
Created on Jul 25, 2019

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 description

API 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().


Acknowledgements:

mit Licensed

Similar vizzes