Hi.
It seems that there is a little misinformation in our documentation as the data aggregation in FacetChart won't work as described because the description corresponds to the TimeChart aggregation. TimeChart will allow you to set index and countIndex.
FacetChart by design displays the values taken from the field that by default is value
.
So you can add the average values to the data:
...
{name: "First", value: 3, avg: 1.5, subvalues: [...]},
{name: "Second", value: 5, avg: 2.21, subvalues: [...]}
...
And then set series fields accordingly.
series:[
{
name: "sum",
data:{field:"value"},
style:{fillColor: "#ccf"}
},
{
name: "average",
data:{field:"avg"},
style:{fillColor:"#bbf"}
}
]