A variable that starts with and = sign is evaluated immediately (ie outside of the chart). Outside the chart the total is 16 (same as entering =sum(value) in a text box).
If you want to use an expression value in a chart, you must save it without the '='
Let total_value = 'sum(value)';
Set total_value = sum(value);
The use the expression in the chart =$(total_value)
Hope that helps