SGR Generate Pie-EN : Différence entre versions

De BlueWiki
(Page créée avec « === Parameters === ---- {| class="wikitable" !Parameter !Type ! !Parameter # !Description |- |valign="top"|Name of Graph's parameters |valign="top"|Pointer |valign="top... »)
 
(Parameters)
 
(13 révisions intermédiaires par un utilisateur sont masquées)
Ligne 1 : Ligne 1 :
 +
[[Composant_Graphe_SVG-EN#Commands|Component Command List ]]
 +
 +
[[SGR_Generate_Pie|Version française de cette page]]
 +
 
=== Parameters ===
 
=== Parameters ===
 
----
 
----
Ligne 18 : Ligne 22 :
 
Possible values ​​of the parameter of the graph are the following:
 
Possible values ​​of the parameter of the graph are the following:
  
# - "Titre" or "Title" : graph title  
+
'''Title parameters'''
# - "Couleur de fond du graphe" or "GraphBGColor" : Background color of the graph
+
* "Titre" or "Title" : graph title
# - "Police du graphe" or "GraphFont" : Font legends and scales
+
* "TitleAlignement" or "alignement du titre" : Title Alignment 0,1,2,3
# - "alignement du titre" or "TitleAlignement" : Title Alignment 0,1,2,3
+
* "Police du graphe" or "GraphFont" : Title font and default font for legend and scale (arial by default)
# - "Affichage de la légende" or "ShowLegend" : Display the legend "yes" or "no"  
+
* "TitleFontSize" or "Taille de la police du titre" : Title font size
 +
* "TitleFontStyle" or "Style de la police du titre" : Title font style (ex (bold+italic))
 +
* "TitleVerticalOffSet" :  Vertical Offset of the title in px
 +
 
 +
 
 +
'''Legend parameters'''
 +
* "ShowLegend" or "Affichage de la légende" : Display the legend "oui", "vrai", "true", "yes", "non", "no", "Faux", "false"
 +
* "legendFont" or "Police de la légende" : Legend font, if this value is passed, it replaces the "graphFont"
 +
* "LegendFontSize" or "Taille de la police de la légende" : Legend font size
 +
* "LegendFontStyle" or "Style de la police de la légende" : Legend font style
 +
* "LegendFontColor" or "Couleur de la police de la légende" : Legend font color
 +
* "LegendBGcolor" or "Couleur de fond de la légende" : Legend background color ("White:0" for transparency)
 +
 
 +
 
 +
'''Value parameters'''
 +
* "ShowValue" or "Affichage des valeurs" (oui/yes/non/no/value/name/%) : Displays the title, value or percentage of each part of the pie
 +
* "ValueFont" or "Police des valeurs" : Font of the displayed values ​​on the graph
 +
* "ValueFontSize" or "Taille de la police des valeurs" : Font size of the displayed values ​​on the graph
 +
* "ValueFontStyle" or "Style de la police des valeurs" : Font style of the displayed values ​​on the graph
 +
* "ValueFontColor" or "Couleur de la police des valeurs" : Font color of the displayed values ​​on the graph
 +
* "ValueFormat" or "Format des valeurs" : Format string values in 4D format (eg. "### ## 0.00%")
 +
 
 +
 
 +
'''General parameters'''
 +
* "Donut" Number of pixels of diameter of central extrusion : the white circle (Our advice: between 300 and 500)
 +
* "reflection" : Displaying the reflection effect on the graph (yes / no) By default reflection is displayed. This is useful for PDF generation because of a bug on Macintosh (4D or driver), you may get a completely black graph.
  
 
|-
 
|-
Ligne 46 : Ligne 75 :
  
 
|-
 
|-
|valign="top"|Couleurs
+
|valign="top"|Colors
 
|valign="top"|Pointer
 
|valign="top"|Pointer
 
|valign="top"|[[File:in.png|caption]]
 
|valign="top"|[[File:in.png|caption]]
 
|valign="top" align="center"|5
 
|valign="top" align="center"|5
|Pointer to an array (type: text) of colors of portions of pie chart
+
|Pointer to an array (type: text) of colors of the parts of pie chart
  
 +
 +
|-
 +
|valign="top"|Parameters of the parts of pie
 +
|valign="top"|Pointer
 +
|valign="top"|[[File:in.png|caption]]
 +
|valign="top" align="center"|6
 +
|Pointer to an array (type: text) of parameters of the parts of pie.
 +
This parameter exists since version 1.2 and is optional, it is used to define the specific parameters of a portion of pie
 +
 +
 +
Example: "range of extraction=100&ShowTheValue=no" will shift part of pie chart outward 100px and will not display the value of this part even if the general view is requested
 
|-
 
|-
 
|Graph
 
|Graph
Ligne 65 : Ligne 105 :
 
This graph will be completely reviewed in the next version
 
This graph will be completely reviewed in the next version
  
=== Exemple de code===
+
The next version will allow you to detach an area and give perspective and depth to the graph
 +
 
 +
===Sample Code===
 
----
 
----
  
Ligne 72 : Ligne 114 :
 
For this graph you will need to use the code below
 
For this graph you will need to use the code below
  
   // Nom utilisateur (OS) : Paul Kuhn - BlueCompany
+
   // User (OS) : Paul Kuhn - BlueCompany
 
   // ----------------------------------------------------
 
   // ----------------------------------------------------
   // Méthode : Exemple_Camembert
+
   // Method : Pie_Sample
+
  // Définition des paramètres de dessin génériques du graphe
+
TABLEAU TEXTE($DataGrapheName;0)
+
TABLEAU TEXTE($DataGraphe;0)
+
AJOUTER A TABLEAU($DataGrapheName;"Title")
+
AJOUTER A TABLEAU($DataGraphe;"Répartition du CA par région")  // 1 - titre du graphe
+
+
AJOUTER A TABLEAU($DataGrapheName;"GraphBGColor")
+
AJOUTER A TABLEAU($DataGraphe;"White")  // 2 - couleur du fond
+
+
AJOUTER A TABLEAU($DataGrapheName;"GraphFont")
+
AJOUTER A TABLEAU($DataGraphe;"times")  // 3 - Police du graphe
+
+
AJOUTER A TABLEAU($DataGrapheName;"ShowLegend")  // Echelles des valeurs
+
AJOUTER A TABLEAU($DataGraphe;"true")  // vrai/faux ou true/false
+
+
AJOUTER A TABLEAU($DataGrapheName;"TitleAlignement")  // Titre du graphe (ne s'affiche pas si vide)
+
AJOUTER A TABLEAU($DataGraphe;Chaine(Centré))
+
 
   
 
   
  TABLEAU TEXTE(Legende;6)
+
  // Definition of generic parameters of the graph
  Legende{1}:="Ile de France"
+
  ARRAY TEXT($DataGrapheName;0)
  Legende{2}:="Provence - Cote d'azur"
+
  ARRAY TEXT($DataGraphe;0)
  Legende{3}:="Rhône-alpe"
+
APPEND TO ARRAY($DataGrapheName;"Title")
  Legende{4}:="Bretagne"
+
  APPEND TO ARRAY($DataGraphe;"Revenue by state")  // title (not shown if empty)
  Legende{5}:="Nord"
+
  APPEND TO ARRAY($DataGrapheName;"GraphBGColor")
  Legende{6}:="Autres"
+
  APPEND TO ARRAY($DataGraphe;"White")  // BackGround color
 +
  APPEND TO ARRAY($DataGrapheName;"GraphFont")
 +
  APPEND TO ARRAY($DataGraphe;"times")  // Font
 +
APPEND TO ARRAY($DataGrapheName;"ShowLegend")  // Echelles des valeurs
 +
APPEND TO ARRAY($DataGraphe;"true")  // vrai/faux ou true/false
 +
APPEND TO ARRAY($DataGrapheName;"TitleAlignement")  // Title alignment
 +
APPEND TO ARRAY($DataGraphe;String(Center))
 
   
 
   
  TABLEAU REEL(ValueC;6)
+
  ARRAY TEXT(Legende;6)
  Boucle ($i;1;6)
+
  Legende{1}:="California"
  ValueC{$i}:=(Hasard%(101))
+
  Legende{2}:="Texas"
  Fin de boucle
+
  Legende{3}:="Florida"
 +
Legende{4}:="South carolina"
 +
Legende{5}:="Michigan"
 +
Legende{6}:="Others"
 
   
 
   
  TABLEAU TEXTE(couleur;6)
+
  ARRAY REAL(ValueC;6)
  couleur{1}:="lightsteelblue"
+
  For ($i;1;6)
  couleur{2}:="pink"
+
  ValueC{$i}:=(Random%(101))
  couleur{3}:="chocolate"
+
  End for
couleur{4}:="darksalmon"
+
couleur{5}:="red"
+
couleur{6}:="green"
+
 
   
 
   
  TheGraphe:=SGR_Generate_Pie (->$DataGrapheName;->$DataGraphe;->Legende;->ValueC;->couleur)
+
ARRAY TEXT(color;6)
 +
color{1}:="lightsteelblue"
 +
color{2}:="pink"
 +
color{3}:="chocolate"
 +
color{4}:="darksalmon"
 +
color{5}:="red"
 +
color{6}:="green"
 +
  TheGraphe:=SGR_Generate_Pie (->$DataGrapheName;->$DataGraphe;->Legende;->ValueC;->color)

Version actuelle en date du 1 décembre 2014 à 08:09

Component Command List

Version française de cette page

[modifier] Parameters


Parameter 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:

Title parameters

  • "Titre" or "Title" : graph title
  • "TitleAlignement" or "alignement du titre" : Title Alignment 0,1,2,3
  • "Police du graphe" or "GraphFont" : Title font and default font for legend and scale (arial by default)
  • "TitleFontSize" or "Taille de la police du titre" : Title font size
  • "TitleFontStyle" or "Style de la police du titre" : Title font style (ex (bold+italic))
  • "TitleVerticalOffSet" : Vertical Offset of the title in px


Legend parameters

  • "ShowLegend" or "Affichage de la légende" : Display the legend "oui", "vrai", "true", "yes", "non", "no", "Faux", "false"
  • "legendFont" or "Police de la légende" : Legend font, if this value is passed, it replaces the "graphFont"
  • "LegendFontSize" or "Taille de la police de la légende" : Legend font size
  • "LegendFontStyle" or "Style de la police de la légende" : Legend font style
  • "LegendFontColor" or "Couleur de la police de la légende" : Legend font color
  • "LegendBGcolor" or "Couleur de fond de la légende" : Legend background color ("White:0" for transparency)


Value parameters

  • "ShowValue" or "Affichage des valeurs" (oui/yes/non/no/value/name/%) : Displays the title, value or percentage of each part of the pie
  • "ValueFont" or "Police des valeurs" : Font of the displayed values ​​on the graph
  • "ValueFontSize" or "Taille de la police des valeurs" : Font size of the displayed values ​​on the graph
  • "ValueFontStyle" or "Style de la police des valeurs" : Font style of the displayed values ​​on the graph
  • "ValueFontColor" or "Couleur de la police des valeurs" : Font color of the displayed values ​​on the graph
  • "ValueFormat" or "Format des valeurs" : Format string values in 4D format (eg. "### ## 0.00%")


General parameters

  • "Donut" Number of pixels of diameter of central extrusion : the white circle (Our advice: between 300 and 500)
  • "reflection" : Displaying the reflection effect on the graph (yes / no) By default reflection is displayed. This is useful for PDF generation because of a bug on Macintosh (4D or driver), you may get a completely black graph.
Parameter values ​​of the graph Pointer caption 2 Pointer to the array of parameter values this array must be the same size as the previous
Part names Pointer caption 3 Pointer to an array (type: text) of the names of portions of pie chart
Values Pointer caption 4 Pointer to an array (type: real) of part values ​of pie chart
Colors Pointer caption 5 Pointer to an array (type: text) of colors of the parts of pie chart


Parameters of the parts of pie Pointer caption 6 Pointer to an array (type: text) of parameters of the parts of pie.

This parameter exists since version 1.2 and is optional, it is used to define the specific parameters of a portion of pie


Example: "range of extraction=100&ShowTheValue=no" will shift part of pie chart outward 100px and will not display the value of this part even if the general view is requested

Graph Picture caption Picture including the SVG code

[modifier] Description


This graph will be completely reviewed in the next version

The next version will allow you to detach an area and give perspective and depth to the graph

[modifier] Sample Code


caption

For this graph you will need to use the code below

 // User (OS) : Paul Kuhn - BlueCompany
 // ----------------------------------------------------
 // Method : Pie_Sample

 // Definition of generic parameters of the graph
ARRAY TEXT($DataGrapheName;0)
ARRAY TEXT($DataGraphe;0)
APPEND TO ARRAY($DataGrapheName;"Title")
APPEND TO ARRAY($DataGraphe;"Revenue by state")  // title (not shown if empty)
APPEND TO ARRAY($DataGrapheName;"GraphBGColor")
APPEND TO ARRAY($DataGraphe;"White")  // BackGround color
APPEND TO ARRAY($DataGrapheName;"GraphFont")
APPEND TO ARRAY($DataGraphe;"times")  // Font
APPEND TO ARRAY($DataGrapheName;"ShowLegend")  // Echelles des valeurs
APPEND TO ARRAY($DataGraphe;"true")  // vrai/faux ou true/false
APPEND TO ARRAY($DataGrapheName;"TitleAlignement")  // Title alignment
APPEND TO ARRAY($DataGraphe;String(Center))

ARRAY TEXT(Legende;6)
Legende{1}:="California"
Legende{2}:="Texas"
Legende{3}:="Florida"
Legende{4}:="South carolina"
Legende{5}:="Michigan"
Legende{6}:="Others"

ARRAY REAL(ValueC;6)
For ($i;1;6)
ValueC{$i}:=(Random%(101))
End for 

ARRAY TEXT(color;6)
color{1}:="lightsteelblue"
color{2}:="pink"
color{3}:="chocolate"
color{4}:="darksalmon"
color{5}:="red"
color{6}:="green"
TheGraphe:=SGR_Generate_Pie (->$DataGrapheName;->$DataGraphe;->Legende;->ValueC;->color)