LaVOZs

The World’s Largest Online Community for Developers

'; python - Plotly showing characters not rendering graph - LavOzs.Com

I am new to Python, Django, and Plotly. I am trying to render a graph but I am unable to do so. The images below depict my problem. When my page loads it displays the graph as a set of characters of the sort. When I click F12 it shows the second image, just partially rendering the graph. I am not sure where I went wrong, I would really appreciate your help.

from plotly.offline import plot
import plotly.graph_objects as go

def home(request):
    """Renders the home page."""
    valuesX = [];
    valuesY = [];
    results = DTH.objects.filter(date__gte = '2019-12-01', date__lte = '2019-12-31');
    for row in results:
        valuesX.append(row.date);
        valuesY.append(row.price);
    #fig = go.Figure([go.Scatter(x=[0,1,2,3], y=[0,1,2,3])]);
    fig = go.Figure([go.Scatter(x=valuesX, y=valuesY)]);
    plt_div = plot(fig, output_type='div', show_link=False, link_text="")
    return render_to_response('app/index.html', { 'plt_div': plt_div })

Image One: Plotly rendered character

Image Two: When F12 is clicked it displays this

Related
How to get the ASCII value of a character
Count the number occurrences of a character in a string
Unable to get custom context processor to be invoked
How can I print literal curly-brace characters in python string and also use .format on it?
What does the 'b' character do in front of a string literal?
UnicodeEncodeError: 'ascii' codec can't encode character u'\xa0' in position 20: ordinal not in range(128)
Unicode string display on Django template
Populating multiple plotly offline plots<div> of HTML page using flask