Skip to content

linechart never loads extras #135

@espguitarist33

Description

@espguitarist33

I noticed that the linechart never builds the extras when serializing to html string. I ran into this once and forgot that I updated the template html, so deploying to a new dev server broke it again and it is pretty deep to see what is actually happening. The python chart class has the method to add (no update) the extras, but it looks like they never actually get written to the html due to it not being in the template.

original html:
{# This template adds attributes unique
to lineChart #}

{% extends "content.html" %}
{% block body %}

{% block data %}
{{super()}}
{% endblock data %}

{% block init %}
{{super()}}
{% endblock init %}

{% block axes %}
{{super()}}
{% endblock axes %}

{% if chart.x_axis_format == 'AM_PM' %}
    function get_am_pm(d){
        if (d > 12) {
            d = d - 12; return (String(d) + 'PM');
        }
        else {
            return (String(d) + 'AM');
        }
    };
{% endif %}

{% block legend %}
{{super()}}
{% endblock legend %}

{% block custoattr %}
{{super()}}
{% endblock custoattr %}

{% block inject %}
{{ super() }}
{% endblock inject %}

{% block close %}
{{ super() }}
{% endblock close %}

{% endblock body %}

My html upated with the work-around:
{# This is a dummy template, we can use that template to add attributes unique
to linechart #}

{% extends "content.html" %}
{% block body %}
    {{ super() }}
{% endblock body %}

Is the linechart not supposed to support extras at all? I'm not sure what the other features that are outlined in the template do, but I have no issues after updating my template to match - I was wondering if {{ super() }} simply needs to be included inside of the body block to let the body parent get initialized?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions