Page 1 sur 1

[JpGraph], comment rendre les bandes transparentes dans la zone de traçage

Posté : 02 nov. 2020, 09:40
par Blaise032
Bonjour,

J'ai donc un graphe dont je voudrais les bandes transparentes (mais je ne suis pas contre les lignes) Le fond de la page est bleu ciel
Pour le moment, les marges et une bande sur deux est transparente.

Image

Je supposais que la solution était dans la classe plotband, que je ne comprends pas fort bien, mais ajouter une bande, ce n'est modifier l'existante !?

À lire vos pistes,
Merci !

Code : Tout sélectionner

<?php // deux courbes Y et dates en X require_once( '../jpgraph/jpgraph.php' ); require_once( '../jpgraph/jpgraph_line.php' ); require_once( '../jpgraph/jpgraph_date.php' ); require_once( '../jpgraph/jpgraph_plotband.php' ); // ici la lecture des données que je passe pour + de clarté // Create the graph. $graph = new Graph( 1000, 400 ); //$graph->title->Set('Pression atmosphérique des 72 dernières heures'); $graph->SetScale( "datlin", $ws_pr_n, $ws_pr_x ); // type X, min et max Y $graph->img->SetMargin( 60, 10, 10, 130 ); $graph->SetMarginColor( 'white' ); $graph->SetFrame( false ); $yh = new LinePLot( $ws_prh, $ws_dt ); $yh->SetFillColor( '#ffff00' ); //jaune $yh->SetColor( '#ffff00' ); $graph->Add( $yh ); $yb = new LinePLot( $ws_prb, $ws_dt ); $yb->SetFillColor( '#0000ff' ); //bleu $yb->SetColor( '#0000ff' ); $graph->Add( $yb ); //Set the angle for the labels to 90 degrees $graph->xaxis->SetLabelAngle( 90 ); $graph->xaxis->SetPos( $ws_pr_n ); // The automatic format string for dates can be overridden $graph->xaxis->scale->SetDateFormat( 'd/m/Y H:i' ); // fond, bandes //$band = new PlotBand( HORIZONTAL, BAND_SOLID, 1015, 1016, 'black' ); //$band->ShowFrame(false); //$band->SetDensity(100); //$graph->AddBand( $band ); //transparence $graph->img->SetTransparent( 'white' ); $graph->title->SetFont( FF_FONT1, FS_BOLD ); $graph->yaxis->SetFont( FF_FONT1, FS_BOLD ); $graph->xaxis->SetFont( FF_FONT1, FS_BOLD ); // Display the graph $graph->Stroke(); ?>