Add get_chart_data sql function

Signed-off-by: Eduardo L. Buratti <elb09@c3sl.ufpr.br>
Fix charts

Signed-off-by: Eduardo L. Buratti <elb09@c3sl.ufpr.br>