<commit_before>from django.views.generic.detail import DetailView
from charts.models import Chart


class ChartDetailView(DetailView):
    model = Chart
    template_name = "chart.html"

    def get_context_data(self, **kwargs):
        context = super(ChartDetailView, self).get_context_data(**kwargs)
        chart = context['chart']
        context['chart_id'] = "'chart'"
        context['type'] = "'line'"
        context['title'] = "'" + str(chart.title) + "'"
        context['xAxis'] = "'X'"
        context['yAxis'] = "'Y'"
        context['series'] = \
            "[" \
            + "{ name: 'horde', data: " \
            + chart.get_data("horde") + ", color: 'red' }" \
            + ",{ name: 'alliance', data: " \
            + chart.get_data('alliance') + ", color: 'blue'}" \
            + ",{name: 'total', data: " \
            + chart.get_data('total') + ", color: 'black' }" \
            + "]"
        return context
<commit_msg>Moved total to the bottom.<commit_after>from django.views.generic.detail import DetailView
from charts.models import Chart


class ChartDetailView(DetailView):
    model = Chart
    template_name = "chart.html"

    def get_context_data(self, **kwargs):
        context = super(ChartDetailView, self).get_context_data(**kwargs)
        chart = context['chart']
        context['chart_id'] = "'chart'"
        context['type'] = "'line'"
        context['title'] = "'" + str(chart.title) + "'"
        context['xAxis'] = "'X'"
        context['yAxis'] = "'Y'"
        context['series'] = \
            "[" \
            + "{name: 'total', data: " \
            + chart.get_data('total') + ", color: 'grey' }" \
            + ",{ name: 'alliance', data: " \
            + chart.get_data('alliance') + ", color: 'blue'}" \
            + ",{ name: 'horde', data: " \
            + chart.get_data("horde") + ", color: 'red' }" \
            + "]"

        return context

{'fraction_non_alphanumeric': 0.18622848200312989, 'fraction_numerical': 0.0, 'mean_word_length': 2.1807628524046434, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1745059', 'n_tokens_mistral': 592, 'n_tokens_neox': 581, 'n_words': 110}