当前位置: 首页>>代码示例>>PHP>>正文


PHP BarPlot::SetYBase方法代码示例

本文整理汇总了PHP中BarPlot::SetYBase方法的典型用法代码示例。如果您正苦于以下问题:PHP BarPlot::SetYBase方法的具体用法?PHP BarPlot::SetYBase怎么用?PHP BarPlot::SetYBase使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BarPlot的用法示例。


在下文中一共展示了BarPlot::SetYBase方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: mybar_new_chart

 public function mybar_new_chart($yearsales, $chainsales, $totalsales, $provinces, $title)
 {
     require_once 'Examples/jpgraph/jpgraph.php';
     require_once 'Examples/jpgraph/jpgraph_bar.php';
     //$data2y = array(41, 2, 3, 4, 5, 6, 17, 8, 19, 10, 11, 12, 13, 14, 25, 16, 17, 48, 1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33);
     //$data1y = $ydata;
     // Create the graph. These two calls are always required
     $graph = new Graph(1024, 468);
     $graph->SetScale("textlin");
     $graph->SetMargin(30, 1, 20, 90);
     // Box around plotarea
     $graph->SetBox();
     // No frame around the image
     $graph->SetFrame(false);
     $graph->title->Set($title);
     $graph->title->SetFont(FF_SIMSUN, FS_BOLD);
     $graph->yaxis->title->SetFont(FF_SIMSUN, FS_BOLD);
     $graph->xaxis->title->SetFont(FF_SIMSUN, FS_BOLD);
     // Setup month as labels on the X-axis
     $graph->xaxis->SetTickLabels($provinces);
     $graph->xaxis->SetFont(FF_SIMSUN, FS_NORMAL, 8);
     $graph->xaxis->SetLabelAngle(35);
     $graph->legend->SetFont(FF_SIMSUN, FS_NORMAL);
     // Create the bar plots
     $b1plot = new BarPlot($yearsales);
     $b1plot->SetFillColor("orange");
     $b1plot->SetLegend("去年同期");
     $b1plot->value->Show();
     $b1plot->value->SetFont(FF_ARIAL, FS_NORMAL, 8);
     $b1plot->value->SetFormat('%d');
     /*
     		$b2plot = new BarPlot($chainsales);
     		$b2plot->SetFillColor("blue");
     		$b2plot->SetLegend("环比");
     		$b2plot->value->Show();
     		$b2plot->value->SetFont(FF_ARIAL,FS_NORMAL,8);
     		$b2plot->value->SetFormat('%d');*/
     $b3plot = new BarPlot($totalsales);
     $b3plot->SetFillColor("yellow");
     $b3plot->SetLegend("销量");
     $b3plot->SetYBase(100);
     $b3plot->value->Show();
     $b3plot->value->SetFont(FF_ARIAL, FS_NORMAL, 8);
     $b3plot->value->SetFormat('%d');
     $graph->legend->SetPos(0.05, 0.5, 'right', 'center');
     // Create the grouped bar plot $gbplot = new GroupBarPlot(array($b2plot,$b1plot,$b3plot));
     $gbplot = new GroupBarPlot(array($b3plot));
     // ...and add it to the graPH
     $graph->Add($gbplot);
     // Display the graph
     $graph->Stroke();
 }
开发者ID:magiclake,项目名称:chaowei,代码行数:52,代码来源:statistic_new.php


注:本文中的BarPlot::SetYBase方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。