SGR Generate TableFromArray-EN : Différence entre versions

De BlueWiki
(Description)
(Parameters)
Ligne 14 : Ligne 14 :
  
 
|-
 
|-
|valign="top"|Nom des paramètres du graphe
+
|valign="top"|Name of Graph's parameters
 
|valign="top"|Pointeur
 
|valign="top"|Pointeur
 
|valign="top"|[[File:in.png|caption]]
 
|valign="top"|[[File:in.png|caption]]
 
|valign="top" align="center"|1
 
|valign="top" align="center"|1
|Pointeur vers un tableau texte qui contient le nom des paramètres, ce tableau doit avoir la même taille que le tableau des valeurs de paramètres du graphe
+
|Pointer to a text array that contains the name of the parameters, this array must have the same size as the array of parameter values ​​of the graph
 +
 +
Possible values ​​of the parameter of the graph are the following:
  
Les valeurs possible de paramètre du graphe sont les suivantes :
+
Title parameters
 +
* "Titre" or "Title" : graph title
 +
* "alignement du titre" ou "TitleAlignement" : Title Alignment 0,1,2,3
 +
* "Police du graphe" ou "GraphFont" : Title font and default font for legend and scale (arial by default)
 +
* "TitleFontSize" ou "Taille de la police du titre" : Title font size
 +
* "TitleFontStyle" ou "Style de la police du titre" : Title font style (ex (bold+italic))
 +
* "TitleFontColor" ou "Couleur de la police du titre" : Title font color
 +
* "TitleVerticalOffSet" or "Décalage vertical du titre" : Vertical offset in px for fine adjustment of its position
  
Paramètres du titre
+
* "GraphBGColor" ou "Couleur de fond du graphe" : Background color of the table
* "Titre" ou "Title" : titre du graphe
+
* "GraphBGColor2" ou "Couleur 2 de fond du graphe" : Second background color of the graph, if you specify a second color which is different from the first you will get a gradient
* "alignement du titre" ou "TitleAlignement" : Alignement du titre 0,1,2,3
+
* "GraphBorderColor" ou "Couleur de bord du graphe" : Color of the line to the edge of the table
* "Police du graphe" ou "GraphFont" : Police du titre et polices par défaut des légendes et des échelles (arial par defaut)
+
* "Police du graphe" ou "GraphFont" : Title font and default font
* "TitleFontSize" ou "Taille de la police du titre" : Taille de la police du titre
+
* "CellMargin" ou "Marge interne des cellules" : Cell padding
* "TitleFontStyle" ou "Style de la police du titre" : Style de la police du titre (ex chaine(gras+italique))
+
* "TitleFontColor" ou "Couleur de la police du titre" : Couleur de la police du titre
+
* "TitleVerticalOffSet" ou "Décalage vertical du titre" : Décalage vertical en px pour un ajustement fin de sa position
+
 
+
* "GraphBGColor" ou "Couleur de fond du graphe" : Couleur du fond du tableau
+
* "GraphBorderColor" ou "Couleur de bord du graphe" : Couleur du trait du bord du tableau
+
 
+
* "CellMargin" ou "Marge interne des cellules" : Marge intérieur des cellules
+
  
  
  
 
|-
 
|-
|valign="top"|Valeurs des paramètres du graphe
+
|valign="top"|Parameter values ​​of the graph
 
|valign="top"|pointeur
 
|valign="top"|pointeur
 
|valign="top"|[[File:in.png|caption]]
 
|valign="top"|[[File:in.png|caption]]
 
|valign="top" align="center"|2
 
|valign="top" align="center"|2
|Pointeur vers le tableau des valeurs des paramètres ce tableau doit être de même taille que le précédent
+
|Pointer to the array of parameter values this array must be the same size as the previous
  
 
|-
 
|-

Version du 2 juillet 2014 à 20:02

Component Command List

Version française

Parameters


Parameters Type Parameter N° Description


Name of Graph's parameters Pointeur caption 1 Pointer to a text array that contains the name of the parameters, this array must have the same size as the array of parameter values ​​of the graph

Possible values ​​of the parameter of the graph are the following:

Title parameters

  • "Titre" or "Title" : graph title
  • "alignement du titre" ou "TitleAlignement" : Title Alignment 0,1,2,3
  • "Police du graphe" ou "GraphFont" : Title font and default font for legend and scale (arial by default)
  • "TitleFontSize" ou "Taille de la police du titre" : Title font size
  • "TitleFontStyle" ou "Style de la police du titre" : Title font style (ex (bold+italic))
  • "TitleFontColor" ou "Couleur de la police du titre" : Title font color
  • "TitleVerticalOffSet" or "Décalage vertical du titre" : Vertical offset in px for fine adjustment of its position
  • "GraphBGColor" ou "Couleur de fond du graphe" : Background color of the table
  • "GraphBGColor2" ou "Couleur 2 de fond du graphe" : Second background color of the graph, if you specify a second color which is different from the first you will get a gradient
  • "GraphBorderColor" ou "Couleur de bord du graphe" : Color of the line to the edge of the table
  • "Police du graphe" ou "GraphFont" : Title font and default font
  • "CellMargin" ou "Marge interne des cellules" : Cell padding


Parameter values ​​of the graph pointeur caption 2 Pointer to the array of parameter values this array must be the same size as the previous
Titre des lignes pointeur caption 3 Pointeur vers le tableau (texte)
Hauteur des lignes pointeur caption 4 Pointeur vers le tableau (Entier long)
Titre des colonnes pointeur caption 5 Pointeur vers le tableau (texte)
Largeur des colonnes pointeur caption 6 Pointeur vers le tableau (Entier long)
Valeurs pointeur caption 7 Pointeur vers le tableau (Texte 2 dimensions)
Images pointeur caption 8 Pointeur vers le tableau (Image 2 dimensions)

L'insertion des images tient compte du paramètre "align" du tableau de mise en forme. Elle tient aussi compte du contenu éventuelle de la cellule

Mise en forme des cellules pointeur caption 9 Pointeur vers le tableau (Texte 2 dimensions)

Ce texte est composé comme une requête REST (ex: "background=mediumvioletred&align=center&fontcolor=white&Fontsize=14&Style=3")


Vous pouvez mettre ou omettre les guillemets autour du nom des attributs ou des valeurs

  • background=mediumvioletred&align=center&fontcolor=white&Fontsize=14&Style=3 est correct
  • "background"="mediumvioletred"&"align"="center"&"fontcolor"="white"&"Fontsize"="14"&"Style"="3" aussi


Les éléments 0 des tableaux sont utilisés pour la mise en page des entêtes de colonnes et titre de lignes

  • $LayoutArray{0}{n} correspond à la ligne n
  • $LayoutArray{n}{0} correspond à la colonne n


Vous pouvez utiliser les élèments suivants :

  • background : couleur de fond de la cellule
  • align : alignement de la cellule, les valeurs possibles sont "Center", "Right" ou "Left"
  • Font : Police de la cellule
  • fontcolor : Couleur de la police
  • Fontsize : Taille de la police
  • Style : Style de la police
  • Border : épaisseur du bord de la cellule
  • BorderColor : couleur du bord de la cellule
Tableau mis en forme Image caption Retour Image du tableau mis en forme incluant le code SVG

Description


This command provides the image of a formatted table.

Code Example


Array.jpg

For this formatted table you should use the code below

 // Nom utilisateur (OS) : Paul Kuhn - BlueCompany
 // Date et heure : 23/12/13, 21:41:15
 // ----------------------------------------------------
 // Méthode : Exemple_Array1

C_PICTURE($rondVert)
$svgRef:=SVG_New 
$objectRef:=SVG_New_circle ($svgRef;10;10;7;"Black";"Lightgreen";1)
$rondVert:=SVG_Export_to_picture ($svgRef)
SVG_CLEAR ($svgRef)

C_PICTURE($rondrouge)
$svgRef:=SVG_New 
$objectRef:=SVG_New_circle ($svgRef;10;10;7;"Black";"red";1)
$rondrouge:=SVG_Export_to_picture ($svgRef)
SVG_CLEAR ($svgRef)

C_PICTURE($rondorange)
$svgRef:=SVG_New 
$objectRef:=SVG_New_circle ($svgRef;10;10;7;"Black";"darkorange";1)
$rondorange:=SVG_Export_to_picture ($svgRef)
SVG_CLEAR ($svgRef)


ARRAY TEXT($DataGrapheName;0)
ARRAY TEXT($DataGraphe;0)
APPEND TO ARRAY($DataGrapheName;"Title")
APPEND TO ARRAY($DataGraphe;"Profil")  // Titre du graphe

APPEND TO ARRAY($DataGrapheName;"GraphBGColor")
APPEND TO ARRAY($DataGraphe;"White")  // Couleur du fond

APPEND TO ARRAY($DataGrapheName;"GraphBorderColor")
APPEND TO ARRAY($DataGraphe;"White")  //Cadre au tour du graph

APPEND TO ARRAY($DataGrapheName;"GraphFont")
APPEND TO ARRAY($DataGraphe;"Tahoma")  // Police de base du tableau

APPEND TO ARRAY($DataGrapheName;"TitleAlignement")
APPEND TO ARRAY($DataGraphe;String(Center))  // Alignement du Titre du graphe

APPEND TO ARRAY($DataGrapheName;"TitleFontSize")
APPEND TO ARRAY($DataGraphe;"32")  // Alignement du Titre du graphe


ARRAY TEXT($LayoutArray;6;21)

If (True)  // Line title
ARRAY TEXT($LineTitle;0)
ARRAY REAL($LineHeight;0)

$LineHeight{0}:=50
APPEND TO ARRAY($LineTitle;"Age")
APPEND TO ARRAY($LineHeight;30)
$LayoutArray{0}{1}:="background=mediumvioletred&align=center&fontcolor=white&Fontsize=14&Style=1"

APPEND TO ARRAY($LineTitle;"Moins de 30 ans")
APPEND TO ARRAY($LineHeight;30)

APPEND TO ARRAY($LineTitle;"De 30 à 40 ans")
APPEND TO ARRAY($LineHeight;30)

APPEND TO ARRAY($LineTitle;"De 41 à 50 ans")
APPEND TO ARRAY($LineHeight;30)

APPEND TO ARRAY($LineTitle;"De 51 à 60 ans")
APPEND TO ARRAY($LineHeight;30)

APPEND TO ARRAY($LineTitle;"Plus de 60 ans")
APPEND TO ARRAY($LineHeight;30)
APPEND TO ARRAY($LineTitle;"Nombre de personnes au foyer")
APPEND TO ARRAY($LineHeight;30)
$LayoutArray{0}{7}:="background=mediumvioletred&align=center&fontcolor=white&Fontsize=14&Style=1"

APPEND TO ARRAY($LineTitle;"1 personne")
APPEND TO ARRAY($LineHeight;30)

APPEND TO ARRAY($LineTitle;"2 personnes")
APPEND TO ARRAY($LineHeight;30)

APPEND TO ARRAY($LineTitle;"3 personnes")
APPEND TO ARRAY($LineHeight;30)

APPEND TO ARRAY($LineTitle;"4 personnes ou plus")
APPEND TO ARRAY($LineHeight;30)

APPEND TO ARRAY($LineTitle;"Bénéficiaire des APL")
APPEND TO ARRAY($LineHeight;30)
$LayoutArray{0}{12}:="background=mediumvioletred&align=center&fontcolor=white&Fontsize=14&Style=1"

APPEND TO ARRAY($LineTitle;"Oui")
APPEND TO ARRAY($LineHeight;30)

APPEND TO ARRAY($LineTitle;"Non")
APPEND TO ARRAY($LineHeight;30)

APPEND TO ARRAY($LineTitle;"Ancienneté dans le logement")
APPEND TO ARRAY($LineHeight;30)
$LayoutArray{0}{15}:="background=mediumvioletred&align=center&fontcolor=white&Fontsize=14&Style=1"

APPEND TO ARRAY($LineTitle;"Moins de 1 an")
APPEND TO ARRAY($LineHeight;30)

APPEND TO ARRAY($LineTitle;"De 1 à 2 ans")
APPEND TO ARRAY($LineHeight;30)

APPEND TO ARRAY($LineTitle;"De 3 à 5 ans")
APPEND TO ARRAY($LineHeight;30)

APPEND TO ARRAY($LineTitle;"De 6 à 10 ans")
APPEND TO ARRAY($LineHeight;30)

APPEND TO ARRAY($LineTitle;"De 11 à 20 ans")
APPEND TO ARRAY($LineHeight;30)

APPEND TO ARRAY($LineTitle;"Plus de 20 ans")
APPEND TO ARRAY($LineHeight;30)
End if 

If (True)  // titres de colonnes
ARRAY TEXT($ColumnTitle;0)
ARRAY REAL($ColumnWidth;0)
$ColumnWidth{0}:=250  // largeur colonne de titre de ligne

APPEND TO ARRAY($ColumnTitle;"")
APPEND TO ARRAY($ColumnWidth;30)
$LayoutArray{1}{0}:="border=0"

APPEND TO ARRAY($ColumnTitle;"2007")
APPEND TO ARRAY($ColumnWidth;120)
$LayoutArray{2}{0}:="background=mediumvioletred&align=center&fontcolor=white&Fontsize=14&Style=3"

APPEND TO ARRAY($ColumnTitle;"")
APPEND TO ARRAY($ColumnWidth;40)
$LayoutArray{3}{0}:="border=0"

APPEND TO ARRAY($ColumnTitle;"2010")
APPEND TO ARRAY($ColumnWidth;120)
$LayoutArray{4}{0}:="background=mediumvioletred&align=center&fontcolor=white&Fontsize=14&Style=3"

APPEND TO ARRAY($ColumnTitle;"")
APPEND TO ARRAY($ColumnWidth;40)
$LayoutArray{5}{0}:="border=0"

APPEND TO ARRAY($ColumnTitle;"2013")
APPEND TO ARRAY($ColumnWidth;120)
$LayoutArray{6}{0}:="background=mediumvioletred&align=center&fontcolor=white&Fontsize=14&Style=3"

End if 

If (True)  // les valeurs
ARRAY TEXT($ValuesArray;6;21)
  // Age
$ValuesArray{1}{1}:=""
$ValuesArray{2}{1}:=""
$ValuesArray{3}{1}:=""
$ValuesArray{4}{1}:=""
$ValuesArray{5}{1}:=""
$ValuesArray{6}{1}:=""

 // Age -30
$ValuesArray{1}{2}:=""
$ValuesArray{2}{2}:="5%"
$ValuesArray{3}{2}:=""
$ValuesArray{4}{2}:="11%"
$ValuesArray{5}{2}:=""
$ValuesArray{6}{2}:="13%"

 // Age 30-40
$ValuesArray{1}{3}:=""
$ValuesArray{2}{3}:="16%"
$ValuesArray{3}{3}:=""
$ValuesArray{4}{3}:="10%"
$ValuesArray{5}{3}:=""
$ValuesArray{6}{3}:="19%"

 // Age 40-50
$ValuesArray{1}{4}:=""
$ValuesArray{2}{4}:="19%"
$ValuesArray{3}{4}:=""
$ValuesArray{4}{4}:="19%"
$ValuesArray{5}{4}:=""
$ValuesArray{6}{4}:="19%"

 // Age 50-60
$ValuesArray{1}{5}:=""
$ValuesArray{2}{5}:="27%"
$ValuesArray{3}{5}:=""
$ValuesArray{4}{5}:="19%"
$ValuesArray{5}{5}:=""
$ValuesArray{6}{5}:="19%"

 // Age 50-60
$ValuesArray{1}{6}:=""
$ValuesArray{2}{6}:="33%"
$ValuesArray{3}{6}:=""
$ValuesArray{4}{6}:="41%"
$ValuesArray{5}{6}:=""
$ValuesArray{6}{6}:="30%"


 // 1p
$ValuesArray{2}{8}:="45%"
$ValuesArray{4}{8}:="54%"
$ValuesArray{6}{8}:="49%"
 // 2p
$ValuesArray{2}{9}:="26%"
$ValuesArray{4}{9}:="25%"
$ValuesArray{6}{9}:="25%"
 // 3p
$ValuesArray{2}{10}:="14%"
$ValuesArray{4}{10}:="10%"
$ValuesArray{6}{10}:="14%"
 // 4p+
$ValuesArray{2}{11}:="15%"
$ValuesArray{4}{11}:="11%"
$ValuesArray{6}{11}:="13%"



 // Yes
$ValuesArray{2}{13}:="71%"
$ValuesArray{4}{13}:="69%"
$ValuesArray{6}{13}:="73%"
 // no
$ValuesArray{2}{14}:="29%"
$ValuesArray{4}{14}:="31%"
$ValuesArray{6}{14}:="27%"



 // -1
$ValuesArray{2}{16}:="34%"
$ValuesArray{4}{16}:="3%"
$ValuesArray{6}{16}:="17%"
 // 1-2
$ValuesArray{2}{17}:="8%"
$ValuesArray{4}{17}:="2%"
$ValuesArray{6}{17}:="12%"
 // 3-5
$ValuesArray{2}{18}:="17%"
$ValuesArray{4}{18}:="23%"
$ValuesArray{6}{18}:="26%"
 // 6-10
$ValuesArray{2}{19}:="17%"
$ValuesArray{4}{19}:="18%"
$ValuesArray{6}{19}:="17%"
 // 10-20
$ValuesArray{2}{20}:="16%"
$ValuesArray{4}{20}:="29%"
$ValuesArray{6}{20}:="17%"
 // +20
$ValuesArray{2}{21}:="8%"
$ValuesArray{4}{21}:="25%"
$ValuesArray{6}{21}:="11%"
End if 
If (True)  // les symboles
ARRAY PICTURE($PictureArray;6;21)
$PictureArray{4}{11}:=$rondorange
$PictureArray{4}{13}:=$rondorange
$PictureArray{4}{14}:=$rondorange

$PictureArray{3}{2}:=$rondVert

$PictureArray{3}{3}:=$rondrouge
$PictureArray{5}{3}:=$rondVert
$PictureArray{3}{5}:=$rondrouge
$PictureArray{3}{6}:=$rondVert
$PictureArray{5}{6}:=$rondrouge

$PictureArray{3}{8}:=$rondVert

$PictureArray{3}{16}:=$rondrouge
$PictureArray{5}{16}:=$rondVert
$PictureArray{3}{17}:=$rondrouge
$PictureArray{5}{17}:=$rondVert
$PictureArray{3}{18}:=$rondVert
$PictureArray{3}{20}:=$rondVert
$PictureArray{5}{20}:=$rondrouge
$PictureArray{3}{21}:=$rondVert
$PictureArray{5}{21}:=$rondrouge
End if 

If (True)  // mise en forme des cellules
ARRAY TEXT($LayoutArray;6;21)
$LayoutArray{1}{1}:="border=0"
$LayoutArray{2}{1}:="border=0"
$LayoutArray{3}{1}:="border=0"
$LayoutArray{4}{1}:="border=0"
$LayoutArray{5}{1}:="border=0"
$LayoutArray{6}{1}:="border=0"

$LayoutArray{1}{7}:="border=0"
$LayoutArray{2}{7}:="border=0"
$LayoutArray{3}{7}:="border=0"
$LayoutArray{4}{7}:="border=0"
$LayoutArray{5}{7}:="border=0"
$LayoutArray{6}{7}:="border=0"

$LayoutArray{1}{12}:="border=0"
$LayoutArray{2}{12}:="border=0"
$LayoutArray{3}{12}:="border=0"
$LayoutArray{4}{12}:="border=0"
$LayoutArray{5}{12}:="border=0"
$LayoutArray{6}{12}:="border=0"

$LayoutArray{1}{15}:="border=0"
$LayoutArray{2}{15}:="border=0"
$LayoutArray{3}{15}:="border=0"
$LayoutArray{4}{15}:="border=0"
$LayoutArray{5}{15}:="border=0"
$LayoutArray{6}{15}:="border=0"


For ($i;1;21)
$LayoutArray{1}{$i}:="border=0&align=center"
$LayoutArray{3}{$i}:="border=0&align=center"
$LayoutArray{5}{$i}:="border=0&align=center"
End for 

For ($i;2;6)
$LayoutArray{2}{$i}:="style=1&align=center"
$LayoutArray{4}{$i}:="style=1&align=center"
$LayoutArray{6}{$i}:="style=1&align=center"

$LayoutArray{0}{$i}:="Fontsize=14"
End for 

For ($i;8;11)
$LayoutArray{2}{$i}:="style=1&align=center"
$LayoutArray{4}{$i}:="style=1&align=center"
$LayoutArray{6}{$i}:="style=1&align=center"

$LayoutArray{0}{$i}:="Fontsize=14"
End for 

For ($i;13;14)
$LayoutArray{2}{$i}:="style=1&align=center"
$LayoutArray{4}{$i}:="style=1&align=center"
$LayoutArray{6}{$i}:="style=1&align=center"

$LayoutArray{0}{$i}:="Fontsize=14"
End for 

For ($i;16;21)
$LayoutArray{2}{$i}:="style=1&align=center"
$LayoutArray{4}{$i}:="style=1&align=center"
$LayoutArray{6}{$i}:="style=1&align=center"

$LayoutArray{0}{$i}:="Fontsize=14"
End for 

$LayoutArray{4}{11}:="style=1&align=center&background=lightgrey:75"
$LayoutArray{4}{13}:="style=1&align=right&background=lightgrey:75"
$LayoutArray{4}{14}:="style=1&align=left&background=lightgrey:75"
End if 
TheGraphe:=SGR_Generate_TableFromArray (\
->$DataGrapheName;\
->$DataGraphe;\
->$LineTitle;\
->$LineHeight;\
->$ColumnTitle;\
->$ColumnWidth;\
->$ValuesArray;\
->$PictureArray;\
->$LayoutArray)