Discussion utilisateur:OD02fr/Archive 1

Le contenu de la page n’est pas pris en charge dans d’autres langues.
Une page de Wikipédia, l'encyclopédie libre.

COPIEZ-COLLEZ LE SCRIPT SUIVANT DANS L'ARTICLE POUR OBTENIR UNE COURBE DÉMOGRAPHIQUE :
(le script EasyTimeline lui-même est en vert et la partie en bleu est une suggestion de présentation)
<div style="text-align: center;">'''Courbe d'évolution démographique de xxxx depuis 1790'''<br><!--
---------- début de graphique en code Timeline, suite de l'article plus loin -------><timeline>
Colors =
  id:grisclair value:gray(0.9)
  id:grisfonce value:gray(0.5)
  id:couleurcourbe value:rgb(0,0.6,0.4)
   
ImageSize = width:746 height:300
PlotArea = left:42 right:11 top:10 bottom:20
TimeAxis = orientation:horizontal
AlignBars = justify
DateFormat = yyyy
Period = from:1785 till:2018
ScaleMajor = unit:year increment:50 start:1785
ScaleMinor = unit:year increment:5 start:1785
 
BarData =
  bar:21 text:1 000
  bar:20 text:
  bar:19 text:900
  bar:18 text:
  bar:17 text:800
  bar:16 text:
  bar:15 text:700
  bar:14 text:
  bar:13 text:600
  bar:12 text:
  bar:11 text:500
  bar:10 text:
  bar:9 text:400
  bar:8 text:
  bar:7 text:300
  bar:6 text:
  bar:5 text:200
  bar:4 text:
  bar:3 text:100
  bar:2 text:
  bar:1 text:0
       
# abscisses des graduations
Define $margegch = 42
Define $margegch5 = 37
Define $margegch2 = 40
# ordonnées des graduations
Define $G1 = 287
Define $G2 = 274
Define $G3 = 260
Define $G4 = 247
Define $G5 = 234
Define $G6 = 220
Define $G7 = 207
Define $G8 = 194
Define $G9 = 180
Define $G10 = 167
Define $G11 = 154
Define $G12 = 140
Define $G13 = 127
Define $G14 = 113
Define $G15 = 100
Define $G16 = 87
Define $G17 = 73
Define $G18 = 60
Define $G19 = 47
Define $G20 = 33
Define $G21 = 20



LineData =
  color:black width:0.5 # graduations de l'échelle de population (tirets sur l'axe vertical + lignes horizontales)
    points:($margegch5,$G1)($margegch,$G1)
  from:start till:end atpos:$G1 color:grisfonce
    points:($margegch2,$G2)($margegch,$G2)
  from:start till:end atpos:$G2 color:grisclair
    points:($margegch5,$G3)($margegch,$G3)
  from:start till:end atpos:$G3 color:grisfonce
    points:($margegch2,$G4)($margegch,$G4)
  from:start till:end atpos:$G4 color:grisclair
    points:($margegch5,$G5)($margegch,$G5)
  from:start till:end atpos:$G5 color:grisfonce
    points:($margegch2,$G6)($margegch,$G6)
  from:start till:end atpos:$G6 color:grisclair
    points:($margegch5,$G7)($margegch,$G7)
  from:start till:end atpos:$G7 color:grisfonce
    points:($margegch2,$G8)($margegch,$G8)
  from:start till:end atpos:$G8 color:grisclair
    points:($margegch5,$G9)($margegch,$G9)
  from:start till:end atpos:$G9 color:grisfonce
    points:($margegch2,$G10)($margegch,$G10)
  from:start till:end atpos:$G10 color:grisclair
    points:($margegch5,$G11)($margegch,$G11)
  from:start till:end atpos:$G11 color:grisfonce
    points:($margegch2,$G12)($margegch,$G12)
  from:start till:end atpos:$G12 color:grisclair
    points:($margegch5,$G13)($margegch,$G13)
  from:start till:end atpos:$G13 color:grisfonce
    points:($margegch2,$G14)($margegch,$G14)
  from:start till:end atpos:$G14 color:grisclair
    points:($margegch5,$G15)($margegch,$G15)
  from:start till:end atpos:$G15 color:grisfonce
    points:($margegch2,$G16)($margegch,$G16)
  from:start till:end atpos:$G16 color:grisclair
    points:($margegch5,$G17)($margegch,$G17)
  from:start till:end atpos:$G17 color:grisfonce
    points:($margegch2,$G18)($margegch,$G18)
  from:start till:end atpos:$G18 color:grisclair
    points:($margegch5,$G19)($margegch,$G19)
  from:start till:end atpos:$G19 color:grisfonce
    points:($margegch2,$G20)($margegch,$G20)
  from:start till:end atpos:$G20 color:grisclair
    points:($margegch5,$G21)($margegch,$G21)
  from:start till:end atpos:$G21 color:grisfonce
       
LineData =
  layer:front color:couleurcourbe width:1 # courbe de population
  points:(57,268)(66,273) # 1790: 929 h. à 1793: 947 h.
  points:(66,273)(93,269) # 1793: 947 h. à 1802: 931 h.
  points:(93,269)(110,268) # 1802: 931 h. à 1808: 929 h.
  points:(110,268)(137,268) # 1808: 929 h. à 1817: 928 h.
  points:(137,268)(146,267) # 1817: 928 h. à 1820: 924 h.
  points:(146,267)(149,266) # 1820: 924 h. à 1821: 922 h.
  points:(149,266)(152,265) # 1821: 922 h. à 1822: 918 h.
  points:(152,265)(155,262) # 1822: 918 h. à 1823: 905 h.
  points:(155,262)(191,261) # 1823: 905 h. à 1835: 904 h.
  points:(191,261)(194,262) # 1835: 904 h. à 1836: 905 h.
  points:(194,262)(256,261) # 1836: 905 h. à 1857: 904 h.
  points:(256,261)(265,261) # 1857: 904 h. à 1860: 903 h.
  points:(265,261)(298,261) # 1860: 903 h. à 1871: 904 h.
  points:(298,261)(342,261) # 1871: 904 h. à 1886: 903 h.
  points:(342,261)(381,261) # 1886: 903 h. à 1899: 904 h.
  points:(381,261)(420,262) # 1899: 904 h. à 1912: 905 h.
  points:(420,262)(500,262) # 1912: 905 h. à 1939: 906 h.
  points:(500,262)(527,262) # 1939: 906 h. à 1948: 907 h.
  points:(527,262)(533,262) # 1948: 907 h. à 1950: 908 h.
  points:(533,262)(577,262) # 1950: 908 h. à 1965: 907 h.
  points:(577,262)(589,262) # 1965: 907 h. à 1969: 906 h.
  points:(589,262)(595,262) # 1969: 906 h. à 1971: 905 h.
  points:(595,262)(598,261) # 1971: 905 h. à 1972: 903 h.
  points:(598,261)(601,260) # 1972: 903 h. à 1973: 899 h.
  points:(601,260)(604,260) # 1973: 899 h. à 1974: 898 h.
  points:(604,260)(646,259) # 1974: 898 h. à 1988: 897 h.
  points:(646,259)(655,259) # 1988: 897 h. à 1991: 896 h.
  points:(655,259)(664,259) # 1991: 896 h. à 1994: 895 h.
  points:(664,259)(670,258) # 1994: 895 h. à 1996: 893 h.
  points:(670,258)(676,259) # 1996: 893 h. à 1998: 894 h.
  points:(676,259)(705,259) # 1998: 894 h. à 2008: 895 h.
  points:(705,259)(729,258) # 2008: 895 h. à 2016: 892 h.
  points:(729,258)(732,258) # 2016: 892 h. à 2017: 891 h.
                                   

LineData =
  color:black width:3 # points de population
  at:1790 frompos:267 tillpos:269 # 929 hab.
  at:1793 frompos:272 tillpos:274 # 947 hab.
  at:1802 frompos:268 tillpos:270 # 931 hab.
  at:1808 frompos:267 tillpos:269 # 929 hab.
  at:1817 frompos:267 tillpos:269 # 928 hab.
  at:1820 frompos:266 tillpos:268 # 924 hab.
  at:1821 frompos:265 tillpos:267 # 922 hab.
  at:1822 frompos:264 tillpos:266 # 918 hab.
  at:1823 frompos:261 tillpos:263 # 905 hab.
  at:1835 frompos:260 tillpos:262 # 904 hab.
  at:1836 frompos:261 tillpos:263 # 905 hab.
  at:1857 frompos:260 tillpos:262 # 904 hab.
  at:1860 frompos:260 tillpos:262 # 903 hab.
  at:1871 frompos:260 tillpos:262 # 904 hab.
  at:1886 frompos:260 tillpos:262 # 903 hab.
  at:1899 frompos:260 tillpos:262 # 904 hab.
  at:1912 frompos:261 tillpos:263 # 905 hab.
  at:1939 frompos:261 tillpos:263 # 906 hab.
  at:1948 frompos:261 tillpos:263 # 907 hab.
  at:1950 frompos:261 tillpos:263 # 908 hab.
  at:1965 frompos:261 tillpos:263 # 907 hab.
  at:1969 frompos:261 tillpos:263 # 906 hab.
  at:1971 frompos:261 tillpos:263 # 905 hab.
  at:1972 frompos:260 tillpos:262 # 903 hab.
  at:1973 frompos:259 tillpos:261 # 899 hab.
  at:1974 frompos:259 tillpos:261 # 898 hab.
  at:1988 frompos:258 tillpos:260 # 897 hab.
  at:1991 frompos:258 tillpos:260 # 896 hab.
  at:1994 frompos:258 tillpos:260 # 895 hab.
  at:1996 frompos:257 tillpos:259 # 893 hab.
  at:1998 frompos:258 tillpos:260 # 894 hab.
  at:2008 frompos:258 tillpos:260 # 895 hab.
  at:2016 frompos:257 tillpos:259 # 892 hab.
  at:2017 frompos:257 tillpos:259 # 891 hab.
                                 

# échelle de temps: le graphe commence à 1785 = 42 px, ensuite chaque année fait 3 px jusqu'à 2018 = 42+3x233 = 741 px
# échelle de population: le graphe va de 20px à 287px, donc 0 hab. = 20px et 1 habitant fait 267/1000 = 0.267 pixel
# et donc l'ordonnée (population) des points est y = 20 + nb(habitants) x 0.267
# Courbe réalisée avec l'aide du modèle [[modèle:Graphique démographique]]

</timeline>
<!---------- fin du graphique en code Timeline --------------------------------------->
</div>

  • Notes importantes pour l'utilisation de ce modèle :
    1. Syntaxe: ce modèle ne fonctionne que pour des populations de la forme 1234567 ou bien de la forme {{formatnum:1234567}}, il ne fonctionne pas si il y a un espace entre les chiffres d'une population ou bien des références.
    2. Pour plus de détails voyez la documentation de ce modèle Graphique démographique.
  • Pour information, valeurs utilisées pour générer le code EasyTimeline qui précède :

| max échelle = 1000
| échelle secondaire = 50
| une graduation principale toutes les = 2

| année min = 1785
| année max = 2018
| couleur courbe = rgb(0,0.6,0.4)

nb éléments échelle = 21 (calculé automatiquement par le modèle)
hauteur image = 300 (calculé automatiquement par le modèle)
hauteur graphe = 267 (calculé automatiquement par le modèle)
marge gauche = 42 (calculé automatiquement par le modèle)
pixels par habitant = 0.267 (calculé automatiquement par le modèle)
pixels par année = 2.9742489270386 (calculé automatiquement par le modèle)