Django Graphos Documentation

Similar documents
django-report-tools Documentation

Django PAM Documentation

webkitpony Documentation

PyZabbixObj Documentation

fragapy Documentation

django-sticky-uploads Documentation

django-ajax-form-mixin Documentation

django-session-security Documentation

Django-Select2 Documentation. Nirupam Biswas

Jquery Ajax Json Php Mysql Data Entry Example

Full Stack Developer with Java

django-baton Documentation

Django Dynamic Fields Documentation

alphafilter Documentation

django-inplaceedit Documentation

Makbul Khan. Nikhil Sukul

Django-CSP Documentation

Django EL(Endless) Pagination Documentation

Security. CSC309 TA: Sukwon Oh

Standard 1 The student will author web pages using the HyperText Markup Language (HTML)

Django Admin Sortable Documentation

Introduction Haim Michael. All Rights Reserved.

gettext.js Documentation

gettext.js Documentation

django-xross Documentation

Using the Visualization API with GWT and Other Advanced Topics. Itai Raz May 27, 2009

mongodb-tornado-angular Documentation

django-ad-code Documentation

Masters in Web Development

Elegans Documentation

kaleo Documentation Release 1.5 Eldarion

Diving into Big Data Workshop

django-baton Documentation

WebGL Seminar: O3D. Alexander Lokhman Tampere University of Technology

Create Web Charts. With jqplot. Apress. Fabio Nelli

Graphing Data from MYSQL By Javier Montiel Urbina

django-autocomplete-light Documentation

django-sekizai Documentation

Bricks Documentation. Release 1.0. Germano Guerrini

Modern Web Application Development. Sam Hogarth

Django File Picker Documentation

Django File Picker Documentation

Byte Academy. Python Fullstack

INFO216: Advanced Modelling

Berner Fachhochschule Haute école spécialisée bernoise Berne University of Applied Sciences 2

Creating an Online Catalogue Search for CD Collection with AJAX, XML, and PHP Using a Relational Database Server on WAMP/LAMP Server

Qiufeng Zhu Advanced User Interface Spring 2017

django-rest-framework-datatables Documentation

a Very Short Introduction to AngularJS

django-dajax Documentation

Sparrow Client (Front-end) API

Comparison Chart Reporting Tools

The course also includes an overview of some of the most popular frameworks that you will most likely encounter in your real work environments.

Django Better Cache Documentation

django-autocomplete-light Documentation

Jquery.ajax Call Returns Status Code Of 200 But Fires Jquery Error

django-osm-field Release 0.3.1

Kiki Documentation. Release 0.7a1. Stephen Burrows

Ten good practices for ASP.NET MVC applications

Etanova Enterprise Solutions

django-facebook-graph Documentation

Deploying to the Edge CouchDB

my6docs Documentation

Django Leaflet Documentation

Release 0.8. Repoze Developers

Stamp Builder. Documentation. v1.0.0

TechWatch Report Javascript Libraries and Frameworks

User Interaction: jquery

Geobarra.org: A system for browsing and contextualizing data from the American Recovery and Reinvestment Act of 2009

django-antispam Documentation

Design Document V2 ThingLink Startup

django-cron Documentation

micawber Documentation

Django Map Widgets Documentation

& Free.

django-telegram-login Documentation

JavaScript Specialist v2.0 Exam 1D0-735

McLab tools on the web. Deepanjan Roy Supervisor: Prof. Laurie Hendren

kiss.py Documentation

By following this instruction you ll be able to create something like the picture below that you can access from anywhere.

Django-frontend-notification Documentation

The Pyramid Web Application Development Framework

Creating Organization Charts for IBM Connections using JavaScript and Google Charts

Overview... 4 JavaScript Charting and Metric Insights... 5

JavaScript Fundamentals_

Jupyter and TMVA. Attila Bagoly (Eötvös Loránd University, Hungary) Mentors: Sergei V. Gleyzer Enric Tejedor Saavedra

0.9: Faster, Leaner and Dijit? July 25, 2007 Dylan Schiemann. presented by

Learn Web Development CodersTrust Polska course outline. Hello CodersTrust! Unit 1. HTML Structuring the Web Prerequisites Learning pathway.

Modern and Responsive Mobile-enabled Web Applications

Homework 9: Stock Search Android App with Facebook Post A Mobile Phone Exercise

Web Client Architecture Guide

Socrates Documentation

Json Parse Error - No Json Object Could Be Decoded Django Rest Framework

django-precise-bbcode Documentation

Web Premium- Advanced UI Development Course. Duration: 08 Months. [Classroom and Online] ISO 9001:2015 CERTIFIED

MARIA KERN NETZ98 GMBH MAGENTO 2 UI COMPONENTS THE JS PART

Spyre Documentation. Release adam hajari

7401ICT eservice Technology. (Some of) the actual examination questions will be more precise than these.

PyBossa.JS JavaScript library for PyBossa

Signals Documentation

Transcription:

Django Graphos Documentation Release 0.0.2a0 Agiliq Aug 21, 2017

Contents 1 Intro to Django-graphos 3 2 Using flot with Django-graphos 5 2.1 Supported chart types.......................................... 5 3 Using Google chart api with graphos 7 3.1 Supported chart types.......................................... 7 4 Doing Ajax with Graphos 9 5 Creating a data source 11 6 Creating custom charts 13 7 Indices and tables 15 i

ii

Django Graphos Documentation, Release 0.0.2a0 Contents: Django-graphos is a tool to create Graphs. (doh). There are two things which Graphos gives you over a low level graph manupulation. It provides various data sources. SimpleDataSource - Use a Python list ModelDataSource MongoDataSource It provides various renderers. Flot Google charts YUI Morris.js (And more) Graphos makes it very easy to switch between different data source and renderers. Are you building your charts with Flot but would like to later switch to Gchart? In many cases, it might be as easy as switching an import statement. Contents 1

Django Graphos Documentation, Release 0.0.2a0 2 Contents

CHAPTER 1 Intro to Django-graphos 3

Django Graphos Documentation, Release 0.0.2a0 4 Chapter 1. Intro to Django-graphos

CHAPTER 2 Using flot with Django-graphos Include the js in your html: <script src="{% sttaic 'js/jquery.flot.js' %}"></script> Create a data source.: from graphos.sources.model import ModelDataSource queryset = Account.objects.all() data_source = ModelDataSource(queryset, fields=['year', 'sales']) Pass the data_source to a flot Chart: from graphos.renderers import flot chart = flot.linechart(data_source) You can render this chart in the template by {{ point_chart.as_html }}. Supported chart types Line Bar Point 5

Django Graphos Documentation, Release 0.0.2a0 6 Chapter 2. Using flot with Django-graphos

CHAPTER 3 Using Google chart api with graphos Include the JS in the template: <script type="text/javascript" src="https://www.google.com/jsapi"></script> <script type="text/javascript"> google.load("visualization", "1", {packages:["corechart"]}); </script> Create a data source.: from graphos.sources.model import ModelDataSource queryset = Account.objects.all() data_source = ModelDataSource(queryset, fields=['year', 'sales']) Pass the data_source to a gchart: from graphos.renderers import gchart chart = gchart.linechart(data_source) You can render this chart in the template by {{ point_chart.as_html }}. Supported chart types Area chart Bar chart Candlestick charts Column chart Line chart Pie chart 7

Django Graphos Documentation, Release 0.0.2a0 8 Chapter 3. Using Google chart api with graphos

CHAPTER 4 Doing Ajax with Graphos Graphos plays well with ajax interactions. There are two ways you can replace a graph object. 1. Render chart.as_html in the views. Return and replace the DOM. 2. Calculate the chart.get_data, return the JSON. Redraw the chart using $.plot or equivalent. 9

Django Graphos Documentation, Release 0.0.2a0 10 Chapter 4. Doing Ajax with Graphos

CHAPTER 5 Creating a data source If you need your chart to get data from a data source we do not natively support, writing a custom data source is easy. Once you do that, the data source can be used in any renderer. To create a new data source 1. Create a class which extends BaseDataSource or SimpleDataSource 2. Make sure your class has implementation of get_data, get_header and get_first_column 3. get_data Should return a NxM matrix (see example data below). Example Data: data = [ ['Year', 'Sales', 'Expenses', 'Items Sold', 'Net Profit'], ['2004', 1000, 400, 100, 600], ['2005', 1170, 460, 120, 310], ['2006', 660, 1120, 50, -460], ['2007', 1030, 540, 100, 200], ] 11

Django Graphos Documentation, Release 0.0.2a0 12 Chapter 5. Creating a data source

CHAPTER 6 Creating custom charts You may need to create custom charts in two scenarios: 1. You want to use a charting libary we do not support. 2. You need more control over the html than chart.as_html provides. To customize html for an existing chart type, you will generally create a new template.: from graphos.renderers import gchart class CustomGchart(gchart.LineChart): def get_template(self): return "demo/gchart_line.html" To create a chart for a new charting backend, create a new class extending BaseChart. This class needs to return the rendrered htmls from as_html method. However in most of the cases you will override the get_templates method. 13

Django Graphos Documentation, Release 0.0.2a0 14 Chapter 6. Creating custom charts

CHAPTER 7 Indices and tables genindex modindex search 15