SGR DrawMap-EN : Différence entre versions

De BlueWiki
(Description)
(Code example)
 
(7 révisions intermédiaires par un utilisateur sont masquées)
Ligne 4 : Ligne 4 :
 
{| class="wikitable"
 
{| class="wikitable"
 
   
 
   
!Paramètres
+
!Parameters
 
!Type
 
!Type
 
!
 
!
!N° du paramètre
+
!Parameter #
 
!Description
 
!Description
 
 
 
|-
 
|-
|valign="top"|Paramètres du graphe
+
|valign="top"|Name of Graph's parameters
|valign="top"|Pointeur
+
|valign="top"|Pointer
 
|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 :
 
  
Paramètres généraux du graphe
+
'''General parameters of the graph'''
* "Police du graphe" ou "GraphFont" : Police du titre et polices par défaut des légendes et des échelles (arial par défaut)
+
* "Police du graphe" ou "GraphFont" : Title and legends font font (default : arial)
* "SVGFile" ou "Fichier SVG" : chemin d'accès au fond de carte dans le dossier "ressource" de 4D
+
* "SVGFile" ou "Fichier SVG" : path to the base map in the "resource" 4D folder
* "ShowLegend" ou "Affichage d'une légende" : afficher une légende
+
* "ShowLegend" ou "Affichage d'une légende" : display a legend
* "LegendLanguage" ou "Langue de la légende" : langue de la légende Français ou English (défaut : french)
+
* "LegendLanguage" ou "Langue de la légende" : legend language, French or English (default: french)
* "Couleur de fond du graphe" ou "GraphBGColor" : Couleur du fond du graphe
+
* "GraphBGColor" ou "Couleur de fond du graphe" : Background color of the table
* "Couleur 2 de fond du graphe" ou "GraphBGColor2" : Deuxième couleur du fond du graphe, si vous spécifiez une deuxième couleur et quelle est différente de la première vous obtiendrez un dégradé
+
* "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
  
  
Paramètres du titre
+
'''Title parameters'''
* "Titre" ou "Title" : titre du graphe
+
* "Titre" or "Title" : graph title
* "alignement du titre" ou "TitleAlignement" : Alignement du titre 0,1,2,3
+
* "alignement du titre" ou "TitleAlignement" : Title Alignment 0,1,2,3
* "TitleFontSize" ou "Taille de la police du titre" : Taille de la police du titre
+
* "TitleFontSize" ou "Taille de la police du titre" : Title font size
* "TitleFontStyle" ou "Style de la police du titre" : Style de la police du titre (ex chaine(gras+italique))
+
* "TitleFontStyle" ou "Style de la police du titre" : Title font style (ex (bold+italic))
* "TitleFontColor" ou "Couleur de la police du titre" : Couleur de la police du titre
+
* "TitleFontColor" ou "Couleur de la police du titre" : Title font color
* "TitleVerticalOffSet" ou "Décalage vertical du titre" : Décalage vertical en px pour un ajustement fin de sa position
+
* "TitleVerticalOffSet" or "Décalage vertical du titre" : Vertical offset in px for fine adjustment of its position
  
  
 
|-
 
|-
|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 text array of parameter values this array must be the same size as the previous
 
+
  
 
|-
 
|-
|valign="top"|Valeurs limites
+
|valign="top"|Limits
 
|valign="top"|Pointeur
 
|valign="top"|Pointeur
 
|valign="top"|[[File:in.png|caption]]
 
|valign="top"|[[File:in.png|caption]]
 
|valign="top" align="center"|3
 
|valign="top" align="center"|3
|Valeurs limites des palier de valeurs
+
|Pointer to the array (real) of limit values ​​of level of values
  
 
|-
 
|-
|valign="top"|Couleurs
+
|valign="top"|Colors
 
|valign="top"|Pointeur
 
|valign="top"|Pointeur
 
|valign="top"|[[File:in.png|caption]]
 
|valign="top"|[[File:in.png|caption]]
 
|valign="top" align="center"|4
 
|valign="top" align="center"|4
|Couleurs à appliquer à la représentation, vous devez définir une couleur de plus que vous n'avez indiqué de valeurs limites
+
|Pointer to the array (text) colors to be applied to the representation, you must define one more color than you have specified limit values
  
 
|-
 
|-
Ligne 65 : Ligne 64 :
 
|valign="top"|[[File:in.png|caption]]
 
|valign="top"|[[File:in.png|caption]]
 
|valign="top" align="center"|5
 
|valign="top" align="center"|5
|Tableau des ID des zones à mettre en couleur
+
|Pointer to the array (text) ID table zones to set color
  
 
|-
 
|-
|valign="top"|Value
+
|valign="top"|Values
 
|valign="top"|Pointeur
 
|valign="top"|Pointeur
 
|valign="top"|[[File:in.png|caption]]
 
|valign="top"|[[File:in.png|caption]]
 
|valign="top" align="center"|6
 
|valign="top" align="center"|6
|Valeurs correspondant à chaque ID pour calculer la couleur en fonction des valeurs limites
+
|Pointer to the array (real) to values ​​corresponding to each ID to calculate the color based on limits
  
 
|-
 
|-
|Résultat
+
|Result
 
|Image
 
|Image
 
|[[File:out.png|caption]]
 
|[[File:out.png|caption]]
 
|valign="top" align="center"|7
 
|valign="top" align="center"|7
|Image incluant le code SVG
+
|Image including SVG code
  
 
|}
 
|}
Ligne 95 : Ligne 94 :
  
  
  // User (OS) : Paul Kuhn - BlueCompany
 
  // Date  : 08/11/13, 10:42:04
 
  // ----------------------------------------------------
 
 
   // Method : Exemple_carte1
 
   // Method : Exemple_carte1
 
   // Description
 
   // Description
Ligne 105 : Ligne 101 :
 
   // ----------------------------------------------------
 
   // ----------------------------------------------------
 
   
 
   
  TABLEAU TEXTE($DataGrapheName;0)
+
  ARRAY TEXT($DataGrapheName;0)
  TABLEAU TEXTE($DataGraphe;0)
+
  ARRAY TEXT($DataGraphe;0)
  AJOUTER A TABLEAU($DataGrapheName;"Title")
+
  APPEND TO ARRAY($DataGrapheName;"Title")
  AJOUTER A TABLEAU($DataGraphe;"Répartition géographique des ventes")  // 1 - Titre du graphe
+
  APPEND TO ARRAY($DataGraphe;"Répartition géographique des ventes")  // 1 - Titre du graphe
 
   
 
   
  AJOUTER A TABLEAU($DataGrapheName;"SVGFile")
+
  APPEND TO ARRAY($DataGrapheName;"SVGFile")
  AJOUTER A TABLEAU($DataGraphe;"Fond_de_carte_France"+Séparateur dossier+"departements.svg")
+
  APPEND TO ARRAY($DataGraphe;"Fond_de_carte_France"+Folder separator+"departements.svg")
 
   
 
   
  AJOUTER A TABLEAU($DataGrapheName;"GraphFont")
+
  APPEND TO ARRAY($DataGrapheName;"GraphFont")
  AJOUTER A TABLEAU($DataGraphe;"Arial")  // Police des légendes et des échelles
+
  APPEND TO ARRAY($DataGraphe;"Arial")  // Police des légendes et des échelles
 
   
 
   
  AJOUTER A TABLEAU($DataGrapheName;"GraphBGColor")
+
  APPEND TO ARRAY($DataGrapheName;"GraphBGColor")
  AJOUTER A TABLEAU($DataGraphe;"LightBlue:30")  // Couleur du fond
+
  APPEND TO ARRAY($DataGraphe;"LightBlue:30")  // Couleur du fond
 
   
 
   
  AJOUTER A TABLEAU($DataGrapheName;"ShowLegend")
+
  APPEND TO ARRAY($DataGrapheName;"ShowLegend")
  AJOUTER A TABLEAU($DataGraphe;"Oui")  // Affichage de la légende
+
  APPEND TO ARRAY($DataGraphe;"Oui")  // Affichage de la légende
 
   
 
   
  AJOUTER A TABLEAU($DataGrapheName;"LegendLanguage")
+
  APPEND TO ARRAY($DataGrapheName;"LegendLanguage")
  AJOUTER A TABLEAU($DataGraphe;"English")  // Affichage de la légende
+
  APPEND TO ARRAY($DataGraphe;"English")  // Affichage de la légende
 
   
 
   
  TABLEAU REEL($valeur_limite;3)
+
  ARRAY REAL($valeur_limite;3)
 
  $valeur_limite{1}:=30
 
  $valeur_limite{1}:=30
 
  $valeur_limite{2}:=60
 
  $valeur_limite{2}:=60
 
  $valeur_limite{3}:=90
 
  $valeur_limite{3}:=90
 
   
 
   
  TABLEAU TEXTE($couleur;3)
+
  ARRAY TEXT($couleur;3)
 
  $couleur{0}:="aquamarine"
 
  $couleur{0}:="aquamarine"
 
  $couleur{1}:="deepskyblue"
 
  $couleur{1}:="deepskyblue"
Ligne 136 : Ligne 132 :
 
  $couleur{3}:="midnightblue"
 
  $couleur{3}:="midnightblue"
 
   
 
   
  TABLEAU REEL($Value;95)
+
  ARRAY REAL($Value;95)
  TABLEAU TEXTE($ZoneID;95)
+
  ARRAY TEXT($ZoneID;95)
  Boucle ($i;1;95)
+
  For ($i;1;95)
  $ZoneID{$i}:=Chaine($i;"00")
+
  $ZoneID{$i}:=String($i;"00")
  $Value{$i}:=(Hasard%(101))
+
  $Value{$i}:=(Random%(101))
  Fin de boucle
+
  End for
 
  $ZoneID{20}:="2A"
 
  $ZoneID{20}:="2A"
  INSERER DANS TABLEAU($ZoneID;21;1)
+
  INSERT IN ARRAY($ZoneID;21;1)
 
  $ZoneID{21}:="2B"
 
  $ZoneID{21}:="2B"
  INSERER DANS TABLEAU($Value;21;1)
+
  INSERT IN ARRAY($Value;21;1)
 
  $Value{21}:=$Value{20}
 
  $Value{21}:=$Value{20}
 
   
 
   
 
  TheGraphe:=SGR_DrawMap (->$DataGrapheName;->$DataGraphe;->$valeur_limite;->$couleur;->$ZoneID;->$Value)
 
  TheGraphe:=SGR_DrawMap (->$DataGrapheName;->$DataGraphe;->$valeur_limite;->$couleur;->$ZoneID;->$Value)
 
<gallery>
 
Fichier:CarteSVG.jpg|Image corresponding to the sample code above
 
</gallery>
 

Version actuelle en date du 2 juillet 2014 à 20:42

Component Command List - Version française

[modifier] Parameters


Parameters Type Parameter # Description
Name of Graph's parameters Pointer 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:


General parameters of the graph

  • "Police du graphe" ou "GraphFont" : Title and legends font font (default : arial)
  • "SVGFile" ou "Fichier SVG" : path to the base map in the "resource" 4D folder
  • "ShowLegend" ou "Affichage d'une légende" : display a legend
  • "LegendLanguage" ou "Langue de la légende" : legend language, French or English (default: french)
  • "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


Title parameters

  • "Titre" or "Title" : graph title
  • "alignement du titre" ou "TitleAlignement" : Title Alignment 0,1,2,3
  • "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


Parameter values ​​of the graph pointeur caption 2 Pointer to the text array of parameter values this array must be the same size as the previous
Limits Pointeur caption 3 Pointer to the array (real) of limit values ​​of level of values
Colors Pointeur caption 4 Pointer to the array (text) colors to be applied to the representation, you must define one more color than you have specified limit values
ZoneID Pointeur caption 5 Pointer to the array (text) ID table zones to set color
Values Pointeur caption 6 Pointer to the array (real) to values ​​corresponding to each ID to calculate the color based on limits
Result Image caption 7 Image including SVG code

[modifier] Description


This command allows colorizing a base map function of values ​​and color gradients.

Zones are listed by their ID and manipulated from thereof.

[modifier] Code example


CarteSVG.jpg


 // Method : Exemple_carte1
 // Description
 // 
 //
 // Parameters
 // ----------------------------------------------------

ARRAY TEXT($DataGrapheName;0)
ARRAY TEXT($DataGraphe;0)
APPEND TO ARRAY($DataGrapheName;"Title")
APPEND TO ARRAY($DataGraphe;"Répartition géographique des ventes")  // 1 - Titre du graphe

APPEND TO ARRAY($DataGrapheName;"SVGFile")
APPEND TO ARRAY($DataGraphe;"Fond_de_carte_France"+Folder separator+"departements.svg")

APPEND TO ARRAY($DataGrapheName;"GraphFont")
APPEND TO ARRAY($DataGraphe;"Arial")  // Police des légendes et des échelles

APPEND TO ARRAY($DataGrapheName;"GraphBGColor")
APPEND TO ARRAY($DataGraphe;"LightBlue:30")  // Couleur du fond

APPEND TO ARRAY($DataGrapheName;"ShowLegend")
APPEND TO ARRAY($DataGraphe;"Oui")  // Affichage de la légende

APPEND TO ARRAY($DataGrapheName;"LegendLanguage")
APPEND TO ARRAY($DataGraphe;"English")  // Affichage de la légende

ARRAY REAL($valeur_limite;3)
$valeur_limite{1}:=30
$valeur_limite{2}:=60
$valeur_limite{3}:=90

ARRAY TEXT($couleur;3)
$couleur{0}:="aquamarine"
$couleur{1}:="deepskyblue"
$couleur{2}:="dodgerblue"
$couleur{3}:="midnightblue"

ARRAY REAL($Value;95)
ARRAY TEXT($ZoneID;95)
For ($i;1;95)
$ZoneID{$i}:=String($i;"00")
$Value{$i}:=(Random%(101))
End for 
$ZoneID{20}:="2A"
INSERT IN ARRAY($ZoneID;21;1)
$ZoneID{21}:="2B"
INSERT IN ARRAY($Value;21;1)
$Value{21}:=$Value{20}

TheGraphe:=SGR_DrawMap (->$DataGrapheName;->$DataGraphe;->$valeur_limite;->$couleur;->$ZoneID;->$Value)