[résolu] Taille d'un lineplot ????

Une question, un bug ?
Répondre
stephrac74
Membre
Messages : 102
Inscription : jeu. août 13, 2009 6:46 pm

[résolu] Taille d'un lineplot ????

Message par stephrac74 »

Bonjour à tous,

Voici mon premier message sur le forum, mais soyez en sûr pas le dernier !

J'ai commencé à créer ma feuille de style, mais j'ai un problème étonnant.
Je suis parti de la feuille 'tab-full-graph' sur lequel il y a deux graphiques

Le premier lineplot a une hauteur de 215 et le second de 265.
Si je modifie la taille du 2e lineplot à 215, donc égal au premier, le graphique apparait beaucoup plus petit (presque 20%)

J'ai essayé plusieurs valeurs et je ne trouve pas de relation simple entre les deux.

Quelle est la raison et comment le corrige t-on ?
Je veux ajouter un 3e lineplot, et j'aurai aimé ne pas définir les valeurs en Y en tâtonnant...

Merci
Stéphane
Dernière modification par stephrac74 le sam. août 22, 2009 10:13 pm, modifié 1 fois.
Avatar de l’utilisateur
TiToine
Site Admin
Messages : 3356
Inscription : lun. mars 20, 2006 11:16 am
Localisation : Montréal
Contact :

Re: Taille d'un lineplot ????

Message par TiToine »

Ca dépend si tu as de l'espace pour un titre ou non.
Il faudrait que tu postes le code xml, et ce que tu as modifié dedans.
stephrac74
Membre
Messages : 102
Inscription : jeu. août 13, 2009 6:46 pm

Re: Taille d'un lineplot ????

Message par stephrac74 »

Bonjour,

En fait je me suis inspiré de d'un stylesheet existant que j'ai complètement modifié. voici le code ci dessous.
Le lineplot 1 et 2 ont la même taille a l'écran, mais 220 contre 260 !!!
Le lineplot 3 est a 220 aussi

Code : Tout sélectionner

<?xml version="1.0" encoding="iso-8859-1" ?>
<stylesheet>

	<!-- =============================================================================
	GraphWeather Stylesheet
	
	Author  : Stéphane Rey 
	Date    : August 2009
	File    : stephrac74-full-graph+stats.xml
	Version : 1.0

	Display :
	- Stats and station information 
	- graph 1 : temperature, pressure, humidity, dew point
	- graph 2 : wind speed, wind gust speed, wind direction
	- graph 3 : relative rainfall, rainfall 1h, rainfall 24h
	
	info : 
	- The paramter backbuffer dimension in Option\directX\ must be set at 900x1200
	- The N/S and E/O direction in Longitude and Latitude must be modified manually 
	  (not supported by GW 2.0.281b
	================================================================================ -->

	<!-- Sheet size -->
	<image width="900" height="1200" />
	
	<!-- ============================================== -->
	<!-- ================= Statistics ================= -->
	<!-- ============================================== -->
	
	<!-- Statistics frame -->
	<frame width="830" height="240" position-x="50" position-y="0" shadow="0">
		<background color1="ffb2c96c" color2="FFFFFFFF" gradient="1" gradient-direction="90" />
		<border cornerradius="10" color="55555555" thick="1" />
	</frame>
	
	<!-- Title and dates -->
	<textbox width="830" height="220" shadow="0" position-x="50" position-y="0" margin="10" >
		<text alignement="left|top">
			<line text="Relevé de mesures"/>
			<font color="FF000000" facename="Arial" size="22" weight="400" italic="0"  />
		</text>
	</textbox>
	
	<textbox width="830" height="220" shadow="0" position-x="50" position-y="20" margin="10" >
		<text alignement="left|top">
			<line text="Du  $StartDate[%A %d %B %Y à %Hh%M]"/>
			<line text="Au  $StopDate[%A %d %B %Y à %Hh%M]"/>
			<font color="FF000000" facename="Arial" size="16" weight="400" italic="1"  />
		</text>
	</textbox>
	
	<!-- Station information -->
	<textbox width="830" height="220" shadow="0" position-x="50" position-y="0" margin="10" >
		<text alignement="right|top">
			<line text="$Country , $Longitude E , $Latitude N"/>
			<line text="Station $Station"/>
			<line text="Heure locale GMT + $Timezone h"/>
			<font color="FF000000" facename="Arial" size="16" weight="400" italic="0"  />
		</text>
	</textbox>
	
	<!-- Report date -->
	<textbox width="800" height="220" shadow="0" position-x="50" position-y="30" margin="10" >
		<text alignement="hcenter|top">
			<line text="Rapport généré le $CurrentDate[%A %d %B %Y à %Hh%M]\n"/>
			<font color="FF000000" facename="Arial" size="14" weight="400" italic="1"  />
		</text>
	</textbox>
	
	<!-- Statistics -->	
	<textbox width="800" height="220" shadow="0" position-x="50" position-y="50" margin="10" >
		<text alignement="left|top">
			<line text="\n\t\t\t\t     Min\t\t\tDate\t\t\t    Max\t\t\tDate \t\t\t  Moyenne"/>
			<line text="\t\t\t\t--------------------------------------------------------------------------------------------------------------------------------------"/>
			<line text="\tPression relative \t$Min[relative_pressure] $Unit[Pressure]\tle $MinDate[relative_pressure, %d/%m/%Y à %Hh%M]\t\t$Max[relative_pressure] $Unit[Pressure]\tle $MaxDate[relative_pressure, %d/%m/%Y à %Hh%M]\t\t$Mean[relative_pressure] $Unit[Pressure]"/>
			<line text="\tTempérature \t\t$Min[outdoor_temperature] °\t\tle $MinDate[outdoor_temperature, %d/%m/%Y à %Hh%M]\t\t$Max[outdoor_temperature] °\t\tle $MaxDate[outdoor_temperature, %d/%m/%Y à %Hh%M]\t\t$Mean[outdoor_temperature] °"/> 
			<line text="\tHumidité \t\t$Min[outdoor_humidity] %\t\tle $MinDate[outdoor_humidity, %d/%m/%Y à %Hh%M]\t\t$Max[outdoor_humidity] %\t\tle $MaxDate[outdoor_humidity, %d/%m/%Y à %Hh%M]\t\t$Mean[outdoor_humidity] %"/>
			<line text="\tPoint de rosée \t\t$Min[dew_point] °\t\tle $MinDate[dew_point, %d/%m/%Y à %Hh%M]\t\t$Max[dew_point] °\t\tle $MaxDate[dew_point, %d/%m/%Y à %Hh%M]\t\t$Mean[dew_point] °"/>
			<line text="\tVitesse du vent\t\t-\t\t-\t\t\t\t$Max[wind_speed] $Unit[Speed]\tle $MaxDate[wind_speed, %d/%m/%Y à %Hh%M]\t\t$Mean[wind_speed] $Unit[Speed] "/>
			<line text="\tRafales de vent\t\t-\t\t-\t\t\t\t$Max[wind_gust] $Unit[Speed]\tle $MaxDate[wind_gust, %d/%m/%Y à %Hh%M]\t\t$Mean[wind_gust] $Unit[Speed] "/>
			<line text="\tPrécipitations / 1h\t-\t\t-\t\t\t\t$Max[rainfall_1h] $Unit[Speed]\tle $MaxDate[rainfall_1h, %d/%m/%Y à %Hh%M]\t\t- "/>
			<line text="\tPrécipitations / 24h\t-\t\t-\t\t\t\t$Max[rainfall_24h] $Unit[Speed]\tle $MaxDate[rainfall_24h, %d/%m/%Y à %Hh%M]\t\t- "/>
			<line text="\tCumul précipitations\t-\t\t-\t\t\t\t$Cumul[relative_rainfall]  $Unit[Rainfall]\t-\t\t\t\t- "/>
			<font color="FF000000" facename="Arial" size="14" weight="400" italic="0"  />
		</text>
	</textbox>

	<!-- ==================================================  -->
	<!-- ================= First Lineplot =================  -->
	<!-- ==================================================  -->

	<!-- Lineplot definition -->
	<lineplot width="900" height="220" shadow="0" position-x="0" position-y="300" margin-top="0" margin-right="140" margin-bottom="0" margin-left="110">
    	<graphbackground color1="11b2c96c" color2="FFFFFFFF" gradient="1" gradient-direction="90" />
    	<border cornerradius="0" color="FF000000" thick="0" />
		
	<!-- Legend definition -->
    <legend orientation="0" width="650" margin="5" position-x="110" position-y="270" hide="0" shadow="0">
    	<font color="FF000000" facename="Arial" size="12" weight="400" italic="0" />
    	<border cornerradius="0" color="55555555" thick="1" />
    	<background color1="aab2c96c" color2="FFFFFFFF" gradient="1" gradient-direction="90" />
    </legend>
	
	<!-- X-Axis definition -->		
    <xaxis color="FF000000" grid="1" autoscale="0" min="0" max="0">
    	<title text="" alignement="vcenter|hcenter" angle="0">
    		<font color="FF000000" facename="Arial" size="12" weight="400" italic="1" />
    	</title>
      	<labels labelinterval="1" angle="0"  side="left" hide="0">
        	<font color="FF000000" facename="Arial" size="12" weight="400" italic="1" />
      	</labels>
      	<ticks majorticks="7" minorticks="3" side="bottom" hidefirst="0" hidelast="0" hideminorticks="0" hide="0" />
    </xaxis>
	
	<!-- Y-Axis definitions -->	
    <y1axis color="FFFF0000" grid="1" autoscale="1" min="0" max="0" titleside="top" titlemargin="25">
      	<title text="Température ($Unit[Temperature])" alignement="vcenter|hcenter" angle="0">
        	<font color="FFFF0000" facename="Arial" size="12" weight="400" italic="1" />
      	</title>
      	<labels labelinterval="1" angle="0" format=".0" side="left" hide="0" >
        	<font color="FFFF0000" facename="Arial" size="12" weight="400" italic="1" />
      	</labels>
      	<ticks majorticks="5" minorticks="4" side="left" hidefirst="0" hidelast="0" hideminorticks="0" hide="0" />
    </y1axis>
	
    <y2axis side="right" color="FF009000" grid="0" autoscale="0" min="980" max="1040" titleside="right" titlemargin="40">
      	<title text="Pression ($Unit[Pressure])" alignement="vcenter|hcenter" angle="0">
        	<font color="FF009000" facename="Arial" size="12" weight="400" italic="1" />
      	</title>
      	<labels labelinterval="1" angle="0" format=".1" side="right" hide="0">
      		<font color="FF009000" facename="Arial" size="12" weight="400" italic="1" />
      	</labels>
      	<ticks majorticks="7" minorticks="3" side="right" hidefirst="0" hidelast="0" hideminorticks="0" hide="0" />
    </y2axis>
	
    <y3axis side="right" color="900000FF" grid="0" autoscale="0" min="0" max="100" titleside="right" ydelta="65" titlemargin="40">
      	<title text="Humidité (%)" alignement="vcenter|hcenter" angle="0">
        	<font color="900000FF" facename="Arial" size="12" weight="400" italic="1" />
      	</title>
      	<labels labelinterval="1" angle="0" format=".1" side="right" hide="0">
        	<font color="900000FF" facename="Arial" size="12" weight="400" italic="1" />
      	</labels>
      	<ticks majorticks="5" minorticks="4" side="right" hidefirst="0" hidelast="0" hideminorticks="0" hide="0" />
    </y3axis>
	
	<!-- data displayed on the lineplot -->
    <data>
    	<outdoor_humidity axisbind="y3axis" legend="Humidité extérieure" color1="30ffffff" color2="300000FF" antialiasing="1" filled="1" hide="0" />
    	<outdoor_humidity axisbind="y3axis" legend="Humidité extérieure" color1="300000FF" antialiasing="1" hidelegend="1" thick="1.2"/>
		<outdoor_temperature axisbind="y1axis" legend="Température ext." color1="FFFF0000" antialiasing="1" filled="0" hide="0" thick="1.5"/>
    	<dew_point axisbind="y1axis" legend="Point de rosée" color1="FF0000FF" antialiasing="1" filled="0" hide="0" thick="1.2"/>
    	<relative_pressure axisbind="y2axis" legend="Pression relative" color1="FF009000" antialiasing="1" filled="0" hide="0" thick="1.5"/>
    </data>

	</lineplot> 
	
	<!-- ==================================================  -->
	<!-- ================= Second Lineplot ================= -->
	<!-- ==================================================  -->

	<!-- Lineplot definition -->	
  	<lineplot width="900" height="260" shadow="0" position-x="0" position-y="600" margin-top="0" margin-right="140" margin-bottom="40" margin-left="110">
    	<border cornerradius="0" color="55555555" thick="0" />
    	<graphbackground color1="11b2c96c" color2="FFFFFFFF" gradient="1" gradient-direction="90" />
 
 	<!-- Legend definition -->
	<legend orientation="0" margin="5" width="650"  position-x="110" position-y="570" hide="0" shadow="0">
      <font color="FF000000" facename="Arial" size="12" weight="400" italic="0" />
      <border cornerradius="0" color="55555555" thick="1" />
      <background color1="aab2c96c" color2="FFFFFFFF" gradient="1" gradient-direction="90" />
    </legend>
     
   	<!-- X-Axis definition -->	
    <xaxis color="FF000000" grid="1" autoscale="0" min="0" max="0">
    	<title text="" alignement="vcenter|hcenter" angle="0">
        	<font color="FF000000" facename="Arial" size="12" weight="400" italic="1" />
      	</title>
      	<labels labelinterval="1" angle="0"  side="left" hide="0">
        	<font color="FF000000" facename="Arial" size="12" weight="400" italic="1" />
      	</labels>
      	<ticks majorticks="7" minorticks="3" side="bottom" hidefirst="0" hidelast="0" hideminorticks="0" hide="0" />
    </xaxis>
  	
	<!-- Y-Axis definition -->	
	<y1axis color="FFFF0000" grid="1" autoscale="1" min="0" max="0" titleside="left" titlemargin="35">
		<title text="Vitesse du vent ( $Unit[Speed] )" alignement="hcenter|vcenter" angle="0">
			<font color="FFFF0000" facename="Arial" size="12" weight="400" italic="1" />
		</title>
		<labels labelinterval="1" angle="0" format=".0" side="left" hide="0" >
			<font color="FFFF0000" facename="Arial" size="12" weight="400" italic="1" />
		</labels>
		<ticks majorticks="5" minorticks="4" side="left" hidefirst="0" hidelast="0" hideminorticks="0" hide="0" />
	</y1axis>
		
	<y2axis side="right" color="FF0000FF" grid="0" autoscale="0" min="0" max="360" titleside="right" titlemargin="40">
		<title text="Direction du vent ( ° )" alignement="vcenter|hcenter" angle="0">
			<font color="FF0000FF" facename="Arial" size="12" weight="400" italic="1" />
		</title>
		<labels labelinterval="1" angle="0" format=".1" side="right" hide="0">
			<font color="FF0000FF" facename="Arial" size="12" weight="400" italic="1" />
		</labels>
		<ticks majorticks="5" minorticks="4" side="right" hidefirst="0" hidelast="0" hideminorticks="0" hide="0" />
	</y2axis>
  	
	<!-- data displayed on the lineplot -->
    <data>
    	<wind_speed axisbind="y1axis" legend="Vitesse du vent" color1="66FF0000" color2="33FF0000" antialiasing="1" filled="1" />
    	<wind_speed axisbind="y1axis" legend="Vitesse du vent" color1="66FF0000" antialiasing="1" filled="0" hidelegend="1" thick="1.2"/>
    	<wind_gust axisbind="y1axis" legend="Rafales" color1="FFFF0000" antialiasing="1" filled="0" hidelegend="0" thick="1.2"/>
   		<wind_direction axisbind="y2axis" legend="Direction du vent" color1="FF0000FF" antialiasing="1" filled="0" hidelegend="0" thick="3" pattern="00000000"/>
    </data>
  
  </lineplot>
  

	<!-- ==================================================  -->
  	<!-- ================= Third Lineplot =================  -->
	<!-- ==================================================  -->

	<!-- Lineplot definition -->	
	<lineplot width="900" height="220" shadow="0" position-x="0" position-y="900" margin-top="0" margin-right="140" margin-bottom="0" margin-left="110">
    	<border cornerradius="0" color="55555555" thick="0" />
    	<graphbackground color1="11b2c96c" color2="FFFFFFFF" gradient="1" gradient-direction="90" />

	<!-- Legend definition -->	
    <legend orientation="0" width="650" margin="5" position-x="110" position-y="870" hide="0" shadow="0">
    	<font color="FF000000" facename="Arial" size="12" weight="400" italic="0" />
    	<border cornerradius="0" color="55555555" thick="1" />
    	<background color1="aab2c96c" color2="FFFFFFFF" gradient="1" gradient-direction="90" />
    </legend>
	
	<!-- X-Axis definition -->		
    <xaxis color="FF000000" grid="1" autoscale="0" min="0" max="0">
    	<title text="" alignement="vcenter|hcenter" angle="0">
        	<font color="FF000000" facename="Arial" size="12" weight="400" italic="1" />
      	</title>
      	<labels labelinterval="1" angle="0"  side="left" hide="0">
        	<font color="FF000000" facename="Arial" size="12" weight="400" italic="1" />
      	</labels>
      	<ticks majorticks="7" minorticks="3" side="bottom" hidefirst="0" hidelast="0" hideminorticks="0" hide="0" />
    </xaxis>
	
	<!-- Y-Axis definitions -->		
    <y1axis color="990000FF" grid="1" autoscale="1" min="0" max="0" titleside="top" titlemargin="35">
    	<title text="Précipitations ($Unit[Rainfall])" alignement="vcenter|hcenter" angle="0">
        	<font color="990000FF" facename="Arial" size="12" weight="400" italic="1" />
      	</title>
      	<labels labelinterval="1" angle="0" format=".2" side="left" hide="0" >
        	<font color="990000FF" facename="Arial" size="12" weight="400" italic="1" />
      	</labels>
      	<ticks majorticks="5" minorticks="4" side="left" hidefirst="0" hidelast="0" hideminorticks="0" hide="0" />
    </y1axis>
	
    <y2axis side="right" color="FFFF0000" grid="0" autoscale="1" min="0" max="0" titleside="right" titlemargin="40">
      	<title text="Précipitations 1h ($Unit[Rainfall])" alignement="vcenter|hcenter" angle="0">
        	<font color="FFFF0000" facename="Arial" size="12" weight="400" italic="1" />
      	</title>
      	<labels labelinterval="1" angle="0" format=".2" side="right" hide="0">
        	<font color="FFFF0000" facename="Arial" size="12" weight="400" italic="1" />
      	</labels>
      	<ticks majorticks="5" minorticks="4" side="right" hidefirst="0" hidelast="0" hideminorticks="0" hide="0" />
    </y2axis>
	
    <y3axis side="right" color="FF009000" grid="0" autoscale="1" min="0" max="0" titleside="right" titlemargin="40" ydelta="70">
      	<title text="Précipitations 24h ($Unit[Rainfall])" alignement="vcenter|hcenter" angle="0">
        	<font color="FF009000" facename="Arial" size="12" weight="400" italic="1" />
      	</title>
      	<labels labelinterval="1" angle="0" format=".2" side="right" hide="0" >
        	<font color="FF009000" facename="Arial" size="12" weight="400" italic="1" />
      	</labels>
      	<ticks majorticks="5" minorticks="4" side="right" hidefirst="0" hidelast="0" hideminorticks="0" hide="0" />
    </y3axis>
	
	<!-- data displayed on the lineplot -->
    <data>
    	<relative_rainfall axisbind="y1axis" legend="Précipitations" color1="660000FF" color2="330000FF" antialiasing="1" filled="1" />
    	<relative_rainfall axisbind="y1axis" legend="Précipitations" color1="660000FF" antialiasing="1" filled="0" hidelegend="1" thick="1.2" />
    	<rainfall_1h axisbind="y2axis" legend="Précipitations 1h" color1="FFFF0000" antialiasing="1" filled="0" hidelegend="0" thick="1.2"/>
    	<rainfall_24h axisbind="y3axis" legend="Précipitations 24h" color1="FF009000" antialiasing="1" filled="0" hidelegend="0" thick="1.2"/>
    </data>
	
</lineplot> 
  
</stylesheet>
Avatar de l’utilisateur
TiToine
Site Admin
Messages : 3356
Inscription : lun. mars 20, 2006 11:16 am
Localisation : Montréal
Contact :

Re: Taille d'un lineplot ????

Message par TiToine »

De mon coté je n'ai pas de différences, chaque lineplot fait 220 pixels de hauteur (en comptant à partir des axes).
Si la différence 220 contre 260 (attribut height entre premier et second lineplot) te choque c'est qu'il y en a un avec une marge (margin-bottom) nulle et l'autre une marge de 40 pixels. Ca revient au même.
Comme il n'y a pas de documentation c'est difficile de le voir...moi même je suis obligé d'aller voir dans le code des fois pour comprendre ce que j'ai fais il y a un certain temps :mrgreen:
stephrac74
Membre
Messages : 102
Inscription : jeu. août 13, 2009 6:46 pm

Re: Taille d'un lineplot ????

Message par stephrac74 »

Ah là là... :oops:
C'était au milieu de mon nez et je l'ai pas vu !

C'est en effet le margin de 40 qui me mettait dans les choux !

Désolé
Stéphane
Répondre