Add chart and metrics to join table in chart_metrics. Fix #521