Python uses Pygal to draw data graphs and monitor charts

Source: Internet
Author: User
Tags rrdtool
Python uses Pygal to draw data graphs and monitor charts 2014-03-18 09:44:14 Tags: python charts python monitor graph Python graphics python data show copyright statement: Original works, declined to reprint. Otherwise, legal liability will be held.

Objective:

Tell me about Python drawing the chart. Charts that previously plotted data typically use RRDtool or the front-end chart JS. Let's talk about RRDtool. This thing is very strong, cacti ganglia all use him, but use up some trouble, of course, with familiar after still calculate can, I have been not how to like to use RRDtool, file format some eggs pain, the second is to save into pictures .... Of course, there is a library, can be directly based on URL get parameters, generate pictures, pressure or in the monitoring master end ... The latter JS diagram is much simpler, I server side just provide a timestamp and value of the corresponding relationship.  Draw the chart or let the customer use the browser to render it themselves. The pressure is not big, the future expansion is quite good to do, just need to do the library synchronization on the line.


Like me, this is the time to test the Golang Python ssdb reading and writing test, the test program is almost, first find a chart. In the foreign Forum found Pygal, this thing is quite capable and simple, his format is more like a highcharts such as JS Chart.

It's simple to use, you just put the data, go to a place to throw, and then use Pygal directly can see. He is a model of SVG HTML.

Original: http://rfyiamcool.blog.51cto.com/1030776/1378400

Pygal is fairly simple to use:

Titile is the title of the chart

X_labels is the data on the horizontal axis

The rest is master data.

An example of Pygal is an HTML containing SVG chart data.


1 2 3 4 5 6 7 8 9 10 11 12-13 Import Pygal Line_chart = Pygal. Line () Line_chart.title = ' Browser usage evolution (in%) ' Line_chart.x_labels = [' 2002 ', ' 2003 ', ' 2004 ', ' 2005 ', ' 2006 '

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.