Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linechart never loads extras #135

Open
espguitarist33 opened this issue Oct 31, 2016 · 0 comments
Open

linechart never loads extras #135

espguitarist33 opened this issue Oct 31, 2016 · 0 comments

Comments

@espguitarist33
Copy link

espguitarist33 commented Oct 31, 2016

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!

quetzaluz added a commit to quetzaluz/python-nvd3 that referenced this issue Mar 14, 2018
areski added a commit that referenced this issue Mar 15, 2018
 Move call to render chart.extras to inheritable template block (issue #135)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant