According to the documentation "An array has to contain a key named 'type' containing the type of bean it represents". So I just had to add $decoded['type'] = 'table_name' before calling R::graph(). It also works if I add a hidden field named 'type' in the form I submit.
<input type="hidden" name="type" value="table_name" />