Hi,
I searched the forum but couldn't find exactly what I was looking for; apologies if this is a common question.
What I'm trying to achieve is a BarPlot that has monthly data in it, and the background of the graph is the cumulative total (I added a format function that looks for the "max" of the dataset so a label will be displayed for the maximum value). Because I have the "cumulative total" in the graph, I'd like to eliminate the Y-Axis labels.
I have seen the sample code where you can access the different Y-axis directly (the $graph->yaxis array), but it looks like this is only the case for multiple LinePlots, perhaps? Because I use AddY2() to insert the other graph, I would think that I would need to somehow use an access function to turn the second axis off.
Does anyone have a suggestion?
Here's my code:
// Create the graph. These two calls are always required
$graph = new Graph(300,300,'auto',1);
$graph->SetScale("textlin");
$graph->setY2Scale('lin');
$graph->SetShadow();
$graph->img->SetMargin(40,30,30,40);
$graph->img->SetTransparent("white");
// Create the bar plots
$b1plot = new BarPlot($webData);
$b1plot->SetFillGradient('AntiqueWhite2','red',GRAD_VERT);
$b1plot->SetColor("darkred");
//Add to the graph
$graph->Add($b1plot);
//add the line chart
$totalPlot = new LinePlot($webDataTotal);
$totalPlot->SetColor("green:1.8");
$totalPlot->SetFillColor("green@0.8");
$totalPlot->SetBarCenter(true);
$totalPlot->value->Show(true);
$totalPlot->value->SetFormatCallback('formatFuncWeb');
//Add the cumulative total to the graph
$graph->AddY2($totalPlot);
//I would like to turn off/hide/etc. the Y2 Axis here...
$graph->legend->SetColumns(2);
$graph->legend->Pos(0.5, 0.01);
//Make it pretty
$graph->title->SetFont(FF_GEORGIA,FS_NORMAL,10);
$graph->yaxis->title->SetFont(FF_GEORGIA, FS_NORMAL);
$graph->xaxis->title->SetFont(FF_GEORGIA,FS_NORMAL);
$graph->yaxis->SetFont(FF_GEORGIA,FS_NORMAL,8);
$graph->xaxis->SetFont(FF_GEORGIA,FS_NORMAL,8);
$graph->Stroke();