Today, we’re posting a lightweight demo for getting started with Python, Django, and ZingChart on our GitHub Repo. This is a simple 'Hello, world' app. It is designed to show Python/Django users how easy it is to put up Python graphs using ZingChart.
Python/Django users may find themselves in a scenario when they need to show data in an interactive chart for the web. This demo is for people in such a situation.
Overview for Python Graphs with ZingChart
Python is serving as the back-end of our app and employs Django's framework to give us a very nice and simple abstraction to get us away from having to configure a server from scratch.
The app we are building today will render a line chart using ZingChart with data gathered from our database via an AJAX call to one of our endpoints.
While this is using the Django framework, it is not too much of a stretch for native Python users to use this project as the basis of their charting/graphing needs. For example, I use Python nearly everyday to assist me in my day-to-day tasks. Tasks like: scheduling meetings, automatically replying to IMs, automate some tests, etc.
One such task I could use Python for is to generate very pretty and easy-to-use charts, but most importantly, interactive charts that I could share with my friends and colleagues with the click of a button. And perhaps the greatest thing about this project is that you do not even have to be a programmer. Let’s get started.
Preparing the Environment
- Python installed. Open a console or terminal and type
python --version. If a version is reported, you're good to go. If not, download Python.
Django installed. One liner, just type into your console/terminal
pip install django. Note: If your terminal complains about permissions, type this in
sudo pip install django.
Download the Python Repo. Or type this into your terminal
git clone https://github.com/zingchart/ZingChart-Demos.git.
Displaying Python Graphs
Change directory to Python/Django/.
Type into terminal
python manage.py runserver.
- The server is running now. So all we have to do is open our favorite browser and navigate to our app.
At this point, to customize the chart, you would follow the documentation for Your First Chart. More controls on the UI are coming soon.
Stay Tuned for More on Python Graphs
We will be putting up a more comprehensive dashboard that will demonstrate the most common use-cases for ZingChart and Python graphs. This may include:
UI interactions with charts
Pulling from Live Feeds (very easy to do with ZingChart)
Chart styling and other general customizations that most of our users have found helpful
Do you have a specific request in this area? Let us know about it in the comments section below.