本文整理汇总了PHP中BarPlot::SetPattern方法的典型用法代码示例。如果您正苦于以下问题:PHP BarPlot::SetPattern方法的具体用法?PHP BarPlot::SetPattern怎么用?PHP BarPlot::SetPattern使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BarPlot
的用法示例。
在下文中一共展示了BarPlot::SetPattern方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
<?php
// content="text/plain; charset=utf-8"
require_once 'jpgraph/jpgraph.php';
require_once 'jpgraph/jpgraph_bar.php';
require_once 'jpgraph/jpgraph_line.php';
$datay = array(2, 3, 5, 8.5, 11.5, 6, 3);
// Create the graph.
$graph = new Graph(350, 300);
$graph->SetScale("textlin");
$graph->SetMarginColor('navy:1.9');
$graph->SetBox();
$graph->title->Set('Bar Pattern');
$graph->title->SetFont(FF_ARIAL, FS_BOLD, 20);
$graph->SetTitleBackground('lightblue:1.3', TITLEBKG_STYLE2, TITLEBKG_FRAME_BEVEL);
$graph->SetTitleBackgroundFillStyle(TITLEBKG_FILLSTYLE_HSTRIPED, 'lightblue', 'blue');
// Create a bar pot
$bplot = new BarPlot($datay);
$bplot->SetFillColor('darkorange');
$bplot->SetWidth(0.6);
$bplot->SetPattern(PATTERN_CROSS1, 'navy');
$graph->Add($bplot);
$graph->Stroke();
示例2: print_graph
//.........这里部分代码省略.........
$graph->ygrid->Show(false);
}
$graph->yaxis->SetLabelMargin(4 * $k);
if ($ylabel) {
$graph->yaxis->title->SetFont(FF_USERFONT, FS_NORMAL, 8 * $k);
$graph->yaxis->SetTitle($ylabel, 'middle');
$graph->yaxis->SetTitleMargin($yaxislblmargin * $k);
}
// Show 0 label on Y-axis (default is not to show)
$graph->yscale->ticks->SupressZeroLabel(false);
// Setup X-axis labels
$graph->xaxis->SetFont(FF_USERFONT, FS_NORMAL, 8 * $k);
$graph->xaxis->SetTickLabels($legends);
$graph->xaxis->SetLabelAngle($xlangle);
$graph->xaxis->SetLabelMargin(4 * $k);
// X-axis title
if ($xlabel) {
$graph->xaxis->title->SetFont(FF_USERFONT, FS_NORMAL, 8 * $k);
$graph->xaxis->SetTitle($xlabel, 'middle');
$graph->xaxis->SetTitleMargin($xaxislblmargin * $k);
}
$group = array();
foreach ($data as $series => $dat) {
$rdata = array();
foreach ($data[$series] as $row) {
$rdata[] = $row;
}
// Create the bar plot
$bplot = new BarPlot($rdata);
$bplot->SetWidth(0.6);
// for SINGLE??
// Setup color for gradient fill style
if ($bandw) {
$bplot->SetPattern($patterns[$series]);
} else {
$bplot->SetFillGradient($fills[$series], "#EEEEEE", GRAD_LEFT_REFLECTION);
}
// Set color for the frame of each bar
$bplot->SetColor("darkgray");
$bplot->SetLegend($labels[$series]);
if ($bandw) {
$bplot->SetShadow("gray5");
}
if ($show_values) {
$bplot->value->Show();
$bplot->value->SetMargin(6 * $k);
$bplot->value->SetColor("darkred");
$bplot->value->SetFont(FF_USERFONT, FS_NORMAL, 8 * $k);
if ($percent || $show_percent) {
$bplot->value->SetFormat('%d%%');
} else {
$bplot->value->SetFormat("%s");
}
}
$group[] = $bplot;
}
if (count($data) == 1) {
$graph->Add($group[0]);
} else {
// Create the grouped bar plot
if ($stacked) {
$gbplot = new AccBarPlot($group);
} else {
$gbplot = new GroupBarPlot($group);
}
$graph->Add($gbplot);