def get_chart(self, request, chart_name, prefix=None):
        if not self.security_check(request):
            raise ChartPermissionError("Chart access forbidden")
        
        report = self._get_report(request, prefix)

        try:
            chart = report[chart_name]
        except KeyError:
            raise ChartNotFoundError("Chart %s not found in this report" % chart_name)
        
        return chart
dataset/ETHPy150Open evanbrumley/django-report-tools/report_tools/views.py/ReportView.get_chart/original