Browse Source

Add french maps doc

doc_major_dots
Florian Mounier 11 years ago
parent
commit
4ac1f769ef
  1. 36
      pages/basic_customizations.rst
  2. 254
      pages/chart_types.rst
  3. 5
      pages/home.rst

36
pages/basic_customizations.rst

@ -277,9 +277,9 @@ Allow label rotation (in degrees) to avoid axis cluttering:
Change minor/major labels Change minor/major labels
~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~
``x_labels_major, x_labels_major_every, x_labels_major_count, show_minor_x_labels`` ``x_labels_major, x_labels_major_every, x_labels_major_count, show_minor_x_labels, y_labels_major, y_labels_major_every, y_labels_major_count, show_minor_y_labels``
You can alter major minor behaviour for the abscissa thanks to `Arjen Stolk <https://github.com/simplyarjen>`_ You can alter major minor behaviour of axes thanks to `Arjen Stolk <https://github.com/simplyarjen>`_
.. pygal-code:: .. pygal-code::
@ -327,6 +327,38 @@ You can alter major minor behaviour for the abscissa thanks to `Arjen Stolk <htt
chart.add('line', [0, .0002, .0005, .00035]) chart.add('line', [0, .0002, .0005, .00035])
.. pygal-code::
chart = pygal.Line(y_label_rotation=-20)
chart.y_labels_major = []
chart.add('line', [0, .0002, .0005, .00035])
.. pygal-code::
chart = pygal.Line()
chart.y_labels_major = [.0001, .0004]
chart.add('line', [0, .0002, .0005, .00035])
.. pygal-code::
chart = pygal.Line(y_label_rotation=20, y_labels_major_every=3)
chart.add('line', [0, .0002, .0005, .00035])
.. pygal-code::
chart = pygal.Line(y_labels_major_count=3)
chart.add('line', [0, .0002, .0005, .00035])
.. pygal-code::
chart = pygal.Line(y_labels_major_every=2, show_minor_y_labels=False)
chart.add('line', [0, .0002, .0005, .00035])
Font size Font size
~~~~~~~~~ ~~~~~~~~~

254
pages/chart_types.rst

@ -545,4 +545,258 @@ The following countries are supported:
- `zw`: Zimbabwe - `zw`: Zimbabwe
Country charts
--------------
As of now, only France is available. As other country are implemented, this will be externalized in other packages.
(Please submit pull requests :))
French map
~~~~~~~~~~
Highlight some departments:
.. pygal-code::
fr_chart = pygal.FrenchMap_Departments()
fr_chart.title = 'Some departments'
fr_chart.add('MĂ©tropole', ['69', '92', '13'])
fr_chart.add('Corse', ['2A', '2B'])
fr_chart.add('DOM COM', ['971', '972', '973', '974'])
You can also specify an number for a department:
.. pygal-code::
fr_chart = pygal.FrenchMap_Departments(human_readable=True)
fr_chart.title = 'Population by department'
fr_chart.add('In 2011', {
'01': 603827,
'02': 541302,
'03': 342729,
'04': 160959,
'05': 138605,
'06': 1081244,
'07': 317277,
'08': 283110,
'09': 152286,
'10': 303997,
'11': 359967,
'12': 275813,
'13': 1975896,
'14': 685262,
'15': 147577,
'16': 352705,
'17': 625682,
'18': 311694,
'19': 242454,
'2A': 145846,
'2B': 168640,
'21': 525931,
'22': 594375,
'23': 122560,
'24': 415168,
'25': 529103,
'26': 487993,
'27': 588111,
'28': 430416,
'29': 899870,
'30': 718357,
'31': 1260226,
'32': 188893,
'33': 1463662,
'34': 1062036,
'35': 996439,
'36': 230175,
'37': 593683,
'38': 1215212,
'39': 261294,
'40': 387929,
'41': 331280,
'42': 749053,
'43': 224907,
'44': 1296364,
'45': 659587,
'46': 174754,
'47': 330866,
'48': 77156,
'49': 790343,
'50': 499531,
'51': 566571,
'52': 182375,
'53': 307031,
'54': 733124,
'55': 193557,
'56': 727083,
'57': 1045146,
'58': 218341,
'59': 2579208,
'60': 805642,
'61': 290891,
'62': 1462807,
'63': 635469,
'64': 656608,
'65': 229228,
'66': 452530,
'67': 1099269,
'68': 753056,
'69': 1744236,
'70': 239695,
'71': 555999,
'72': 565718,
'73': 418949,
'74': 746994,
'75': 2249975,
'76': 1251282,
'77': 1338427,
'78': 1413635,
'79': 370939,
'80': 571211,
'81': 377675,
'82': 244545,
'83': 1012735,
'84': 546630,
'85': 641657,
'86': 428447,
'87': 376058,
'88': 378830,
'89': 342463,
'90': 143348,
'91': 1225191,
'92': 1581628,
'93': 1529928,
'94': 1333702,
'95': 1180365,
'971': 404635,
'972': 392291,
'973': 237549,
'974': 828581,
'976': 212645
})
You can do the same with regions:
.. pygal-code::
fr_chart = pygal.FrenchMap_Regions()
fr_chart.title = 'Some regions'
fr_chart.add('MĂ©tropole', ['82', '11', '93'])
fr_chart.add('Corse', ['94'])
fr_chart.add('DOM COM', ['01', '02', '03', '04'])
You can also specify an number for a region and use a department to region aggregation:
.. pygal-code::
from pygal.graph.frenchmap import aggregate_regions
fr_chart = pygal.FrenchMap_Regions(human_readable=True)
fr_chart.title = 'Population by department'
fr_chart.add('In 2011', aggregate_regions({
'01': 603827,
'02': 541302,
'03': 342729,
'04': 160959,
'05': 138605,
'06': 1081244,
'07': 317277,
'08': 283110,
'09': 152286,
'10': 303997,
'11': 359967,
'12': 275813,
'13': 1975896,
'14': 685262,
'15': 147577,
'16': 352705,
'17': 625682,
'18': 311694,
'19': 242454,
'2A': 145846,
'2B': 168640,
'21': 525931,
'22': 594375,
'23': 122560,
'24': 415168,
'25': 529103,
'26': 487993,
'27': 588111,
'28': 430416,
'29': 899870,
'30': 718357,
'31': 1260226,
'32': 188893,
'33': 1463662,
'34': 1062036,
'35': 996439,
'36': 230175,
'37': 593683,
'38': 1215212,
'39': 261294,
'40': 387929,
'41': 331280,
'42': 749053,
'43': 224907,
'44': 1296364,
'45': 659587,
'46': 174754,
'47': 330866,
'48': 77156,
'49': 790343,
'50': 499531,
'51': 566571,
'52': 182375,
'53': 307031,
'54': 733124,
'55': 193557,
'56': 727083,
'57': 1045146,
'58': 218341,
'59': 2579208,
'60': 805642,
'61': 290891,
'62': 1462807,
'63': 635469,
'64': 656608,
'65': 229228,
'66': 452530,
'67': 1099269,
'68': 753056,
'69': 1744236,
'70': 239695,
'71': 555999,
'72': 565718,
'73': 418949,
'74': 746994,
'75': 2249975,
'76': 1251282,
'77': 1338427,
'78': 1413635,
'79': 370939,
'80': 571211,
'81': 377675,
'82': 244545,
'83': 1012735,
'84': 546630,
'85': 641657,
'86': 428447,
'87': 376058,
'88': 378830,
'89': 342463,
'90': 143348,
'91': 1225191,
'92': 1581628,
'93': 1529928,
'94': 1333702,
'95': 1180365,
'971': 404635,
'972': 392291,
'973': 237549,
'974': 828581,
'976': 212645
}))
Next: `Styles </styles>`_ Next: `Styles </styles>`_

5
pages/home.rst

@ -5,7 +5,7 @@
Presentation Presentation
============ ============
pygal 1.3.0 is a dynamic SVG charting library. pygal 1.4.0 is a dynamic SVG charting library.
.. class:: thumbs .. class:: thumbs
@ -64,6 +64,8 @@ It features various graph types:
- `Worldmap charts </chart_types/#idworldmap-charts>`_ - `Worldmap charts </chart_types/#idworldmap-charts>`_
- `Country charts </chart_types/#country-charts>`_
Python/Css styling with some pre-defined themes. See `styling </styles/>`_. Python/Css styling with some pre-defined themes. See `styling </styles/>`_.
@ -97,6 +99,7 @@ Needed dependencies
pygal uses `lxml <http://lxml.de/>`_ to generate the svg, this is the only needed dependency. pygal uses `lxml <http://lxml.de/>`_ to generate the svg, this is the only needed dependency.
Optional dependencies Optional dependencies
--------------------- ---------------------

Loading…
Cancel
Save