Giter Club home page Giter Club logo

Comments (6)

shabda avatar shabda commented on August 21, 2024

Good idea. 👍 we will have this in the next release.

from django-graphos.

karambir avatar karambir commented on August 21, 2024

PR #15 resolves this issue. It retains {{ chart.as_html }} to render both and add {{ chart.render_html }}, {{ chart.render_js }} to render html and js only. We can update demo_project with new tags after merging this PR.

from django-graphos.

tkwon avatar tkwon commented on August 21, 2024

This PR is ready, just not merged. I hope someone can merge it because I'm eager to use this feature.

from django-graphos.

akshar-raaj avatar akshar-raaj commented on August 21, 2024

@8ksoft @tkwon The PR for this is merged into master. Can you check if this is what you wanted. Please feel free to reopen this issue if you think it's not fixed.

from django-graphos.

akshar-raaj avatar akshar-raaj commented on August 21, 2024

@8ksoft @tkwon After merging PR for suggested changes, now the following can be done in the template:

{% block comment %}
    Javascript section
{% endcomment %}
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
      google.load("visualization", "1", {packages:["corechart"]});
</script>
{{chart.render_js}}

{% block comment %}
   Html section
{% endcomment %}
{{chart.render_html}}

This assumes that view has following code:

sd = SimpleDataSource(data)
chart = gchart.LineChart(sd)
context = {'chart': chart}
return render(request, 'some_template.html', context)

from django-graphos.

tkwon avatar tkwon commented on August 21, 2024

Great!

from django-graphos.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.