almaha
asked on
more than one plot
what's wrong with the following code!
// Create a red line plot
$p1 = new LinePlot($datay);
$p1->SetColor("red");
// Create the 1st rate bar plot
$b1 = new BarPlot($databary1);
$b1->SetLegend("rate#1");
$b1->SetFillColor("orange" );
$b1->SetAbsWidth(;
// Create the 2nd rate bar plot
$b2 = new BarPlot($databary2);
$b2->SetLegend("rate#2");
$b2->SetFillColor("Blue");
$b2->SetAbsWidth(;
// Create the 2nd rate bar plot
$b3 = new BarPlot($databary3);
$b3->SetLegend("rate#3");
$b3->SetFillColor("Yellow" );
$b3->SetAbsWidth(;
// Drop shadow on bars adjust the default values a little bit
$b1->SetShadow("steelblue" ,2,2);
$b2->SetShadow("red",2,2);
$b3->SetShadow("Yellow",2, 2);
// Create the grouped bar plot
$gbplot = new GroupBarPlot(array($p1,$b1 ,$b2,$b3)) ;
then the stroke comes!
i can't find out what's wrong. i keep getting this msg:
JpGraph: Can't draw unspecified Y-scal.
you have either:
specified an Y axis for autoscaling but hanve not supplied any plots
specified a scale manually but have forgot to specify the tick steps
Maha
// Create a red line plot
$p1 = new LinePlot($datay);
$p1->SetColor("red");
// Create the 1st rate bar plot
$b1 = new BarPlot($databary1);
$b1->SetLegend("rate#1");
$b1->SetFillColor("orange"
$b1->SetAbsWidth(;
// Create the 2nd rate bar plot
$b2 = new BarPlot($databary2);
$b2->SetLegend("rate#2");
$b2->SetFillColor("Blue");
$b2->SetAbsWidth(;
// Create the 2nd rate bar plot
$b3 = new BarPlot($databary3);
$b3->SetLegend("rate#3");
$b3->SetFillColor("Yellow"
$b3->SetAbsWidth(;
// Drop shadow on bars adjust the default values a little bit
$b1->SetShadow("steelblue"
$b2->SetShadow("red",2,2);
$b3->SetShadow("Yellow",2,
// Create the grouped bar plot
$gbplot = new GroupBarPlot(array($p1,$b1
then the stroke comes!
i can't find out what's wrong. i keep getting this msg:
JpGraph: Can't draw unspecified Y-scal.
you have either:
specified an Y axis for autoscaling but hanve not supplied any plots
specified a scale manually but have forgot to specify the tick steps
Maha
ASKER
didn't work:(
any other solution?
i don't know what's wrong. i keep getting the same error msg:S
Maha
any other solution?
i don't know what's wrong. i keep getting the same error msg:S
Maha
can u post ur code here ?
lk
lk
ASKER
there is a problem in this example code i downloaded with the jpgraph libraries!
any solutions?
<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
include ("../jpgraph_error.php");
$errdatay = array(11,9,2,4,19,26,13,19 ,7,12);
$datax=array("Jan","Feb"," Mar","Apr" ,"May");
// Create the graph. These two calls are always required
$graph = new Graph(300,200,"auto");
$graph->img->SetMargin(40, 30,20,40);
$graph->SetScale("textlin" );
$graph->SetShadow();
$graph->xaxis->SetLabelAng le(0);
$graph->xaxis->SetFont(FF_ ARIAL,FS_N ORMAL,10);
$graph->img->SetAntiAliasi ng("white" );
// Create the linear plot
$errplot=new ErrorLinePlot($errdatay);
$errplot->SetColor("red");
$errplot->SetWeight(2);
$errplot->SetCenter();
$errplot->line->SetWeight( 2);
$errplot->line->SetColor(" blue");
$errplot->SetLegend("Min/M ax");
$errplot->line->SetLegend( "Average") ;
// Add the plot to the graph
$graph->Add($errplot);
$graph->title->Set("Exampl e 16");
$graph->yaxis->title->Set( "Y-title") ;
$graph->yaxis->title->SetF ont(FF_FON T1,FS_BOLD );
$graph->xaxis->title->Set( "X-title") ;
$graph->title->SetFont(FF_ FONT1,FS_B OLD);
$graph->xaxis->SetTickLabe ls($datax) ;
$graph->xaxis->SetTextTick Interval(2 );
// Display the graph
$graph->Stroke();
?>
it's example16.php
Maha
any solutions?
<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
include ("../jpgraph_error.php");
$errdatay = array(11,9,2,4,19,26,13,19
$datax=array("Jan","Feb","
// Create the graph. These two calls are always required
$graph = new Graph(300,200,"auto");
$graph->img->SetMargin(40,
$graph->SetScale("textlin"
$graph->SetShadow();
$graph->xaxis->SetLabelAng
$graph->xaxis->SetFont(FF_
$graph->img->SetAntiAliasi
// Create the linear plot
$errplot=new ErrorLinePlot($errdatay);
$errplot->SetColor("red");
$errplot->SetWeight(2);
$errplot->SetCenter();
$errplot->line->SetWeight(
$errplot->line->SetColor("
$errplot->SetLegend("Min/M
$errplot->line->SetLegend(
// Add the plot to the graph
$graph->Add($errplot);
$graph->title->Set("Exampl
$graph->yaxis->title->Set(
$graph->yaxis->title->SetF
$graph->xaxis->title->Set(
$graph->title->SetFont(FF_
$graph->xaxis->SetTickLabe
$graph->xaxis->SetTextTick
// Display the graph
$graph->Stroke();
?>
it's example16.php
Maha
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
$gbplot= new GroupBarPlot(array($b1,$b2
then add ur group bar plot to ur graph
$graph->Add($gbplot);
//add ur line plot
$graph->Add($p1);
then ur stroke.
ope this helps..
LK