Charts

Репозиторий: 
git://iportnov.ru/charts.git

Скрипт для создания несложных диаграмм. Умеет создавать вертикальные и горизонтальные столбцовые диаграммы,а также круговые диаграммы (их он создает по умолчанию).

Главная цель написания - получить инструмент, позволяющий быстро создавать более-менее приличные диаграммы, указывая минимум опций. В простейшем случае вызывается так:

charts.py < input.dat

Описание опций коммандной строки можно получить по charts.py --help:

$ ./charts.py --help 
Synopsis: charts.py [options] {--bars|--hbars|--pie} < input.dat
Options:
  -o outfile.png  specify output (PNG) file;
  -d delimiter    specify fields delimiter for input data;
  -t              transpose data matrix;
  -F              first line of data represents fields names;
  -L              hide the legend;
  -l num          left padding (defaults to 45px)
  -b num          bottom padding (defaults to 35px)
  -W num          width of overall drawing (defaults to 500px)
  -H num          height of overall drawing (defaults to 400px)
  -s {log|sqr|sqrt} apply given function to data before plotting;
  --bars          draw bar chart;
  --hbars         draw horizontal bar chart;
  --pie           draw pie chart (default).

Опцией -d можно задать разделитель полей (по умолчанию разделителями считаются пробел и табуляция). Опция -F указывает, что имена полей записаны в первой строке входного файла (по умолчанию, поля именуются V1, V2, ...). Опция -L отключает легенду. Опции -l и -b задают отступы (в пикселах) от соответственно левого и нижнего краев рисунка до диаграммы. Опции -W и -H задают размер рисунка в пикселах. С помощью опции -s можно задать преобразование входных данных - скажем, взять логарифм.

Например, картинка справа получается вот такой командой:

charts.py -W 800 -F -t -d'|' --bars

из вот таких данных:

Время|Хосты|Посетители|Хиты
25.02 - 02.03|69|72|81
03.03 - 09.03|45|45|50
10.03 - 16.03|48|48|50
17.03 - 23.03|201|203|246
24.03 - 30.03|65|63|68
31.03 - 06.04|57|57|66
07.04 - 13.04|68|69|74
14.04 - 20.04|69|69|69
21.04 - 27.04|51|51|52
28.04 - 04.05|59|59|61

Требует PyCha.

04/01/2009 - 12:37

не вижу картинки справа

03/02/2012 - 09:50

:I think this wibtese has some rattling excellent info for everyone . America is not merely a nation but a nation of nations. by Lyndon B. Johnson.

04/25/2012 - 02:33

下载 0.1.2 后执行报错,之前的 0.1.1b 正常,WIN7 环境。Traceback (most recent call last): File SS.py , line 404, in File SS.py , line 200, in __init__ File SS.py , line 235, in __set_properties File wx\_controls.pyo , line 3875, in Realizewx._core.PyAssertionError: C++ aeirstson wxAssertFailure failed at ..\..\src\msw\tbar95.cpp(726) in wxToolBar::Realize(): invalid tool button bitmapException TypeError: NoneType' object is not callable in ignored

04/27/2012 - 03:35

In the past, Yamapi never won (or just once I forgot) 讀者票#1 agnaist other Johnny's artistes. He always lost to Arashi, Kattun or SMAP members ..So I think this time more ppl other than his fans voted for him is one of the reason he won

04/01/2009 - 12:46

ffsdmad@ffsdmad:~/Projects/charts$ sudo aptitude install python2.5-pychart
Чтение списков пакетов... Готово
Построение дерева зависимостей
Чтение информации о состоянии... Готово
Чтение информации о расширенных состояниях
Инициализация состояний пакетов... Готово
Построение базы данных тегов... Готово
Следующие пакеты будут автоматически удержаны:
libavcodec1d libavformat1d libavutil1d libnss3-1d libpostproc1d libswscale1d thunderbird
Следующие пакеты оставлены не обновлёнными:
ffmpeg gstreamer0.10-esd gstreamer0.10-plugins-good libglib2.0-0 libglib2.0-0-dbg libglib2.0-data libglib2.0-dev libglib2.0-doc libjasper1 libnss3-0d linux-generic
linux-headers-generic linux-image-generic linux-restricted-modules linux-restricted-modules-generic
0 пакетов обновлено, 0 установлено новых, 0 пакетов отмечено для удаления, и 22 пакетов не обновлено.
Необходимо получить 0Б архивов. После распаковки 0Б будет занято.
Чтение списков пакетов... Готово
Построение дерева зависимостей
Чтение информации о состоянии... Готово
Чтение информации о расширенных состояниях
Инициализация состояний пакетов... Готово
Построение базы данных тегов... Готово
ffsdmad@ffsdmad:~/Projects/charts$
ffsdmad@ffsdmad:~/Projects/charts$
ffsdmad@ffsdmad:~/Projects/charts$ ./charts.py us.dat
Traceback (most recent call last):
File "./charts.py", line 9, in
import pycha.bar
ImportError: No module named pycha.bar

04/03/2009 - 07:09

pycha - это не то же, что pychart. Pycha: http://www.lorenzogil.com/projects/pycha/
В unstable есть пакет python-pycha.

03/02/2012 - 04:45

You are right this kind of eptryncion provides no security a simple regular expression is enough to decrypt it. I even created a sample application to

05/01/2012 - 03:42

下载 0.1.2 后执行报错,之前的 0.1.1b 正常,WIN7 环境。Traceback (most recent call last): File SS.py , line 404, in File SS.py , line 200, in __init__ File SS.py , line 235, in __set_properties File wx\_controls.pyo , line 3875, in Realizewx._core.PyAssertionError: C++ aestrsion wxAssertFailure failed at ..\..\src\msw\tbar95.cpp(726) in wxToolBar::Realize(): invalid tool button bitmapException TypeError: NoneType' object is not callable in ignored

05/14/2012 - 07:02

http://www.autoplansearch.com/|free car insurance quotes 126609 http://www.freeinsurestimates.com/|life insurance quotes idnqcy

04/24/2012 - 13:51

It is fine. Only the social scrteiuy number and name needed to match. The addresses do not have to match. If a person moves after the W-2 is printed and before they file, then the addresses cannot match.

03/02/2012 - 02:25

Good to see a talnet at work. I can't match that.

RSS-материал