# Hierarchical Bar Chart Not Working

**URL:** <https://talk.observablehq.com/t/hierarchical-bar-chart-not-working/4463>\
**Category:** Uncategorized\
**Created:** [January 15, 2021, 12:00pm UTC](https://talk.observablehq.com/t/hierarchical-bar-chart-not-working/4463 "2021-01-15T12:00:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![karguvel7](https://avatars.discourse-cdn.com/v4/letter/k/f05b48/32.png) [@karguvel7](https://talk.observablehq.com/u/karguvel7)\
**Post date:** [January 15, 2021, 12:00pm UTC](https://talk.observablehq.com/t/hierarchical-bar-chart-not-working/4463/1 "2021-01-15T12:00:26Z")

</div>

Hi Team,  
Hierarchical bar chart not working in angular application.

root = d3Hierarchy.hierarchy(MBOSTOCK)  
.sum(d =\> d.value)  
.sort((a, b) =\> b.value - a.value)  
.eachAfter(d =\> d.index = d.parent ? d.parent.index = d.parent.index + 1 || 0 : 0)  
Error :  
[ts] Property ‘value’ does not exist on type ‘{ “name”: string; “children”: { “name”: string; “children”: ({ “name”: string; “children”: ({ "na…’.

---

<div class="post-metadata">

**Author:** ![karguvel7](https://avatars.discourse-cdn.com/v4/letter/k/f05b48/32.png) [@karguvel7](https://talk.observablehq.com/u/karguvel7)\
**Post date:** [January 15, 2021, 12:05pm UTC](https://talk.observablehq.com/t/hierarchical-bar-chart-not-working/4463/2 "2021-01-15T12:05:32Z")

</div>

Hi Team,  
Angular D3 NPM installed successfully but Observable sample code not working.

1. Installed NPM D3.
2. Following code from [Hierarchical Bar Chart / D3 / Observable](https://observablehq.com/@d3/hierarchical-bar-chart)

Error :  
root = d3Hierarchy.hierarchy(MBOSTOCK[0])  
.sum(d =\> d.value)  
.sort((a, b) =\> b.value - a.value)  
.eachAfter(d =\> d.index = d.parent ? d.parent.index = d.parent.index + 1 || 0 : 0)

Error :  
[ts] Property ‘value’ does not exist on type ‘{ “name”: string; “children”: { “name”: string; “children”: ({ “name”: string; “children”: ({ "na…’.
