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


PHP PHPlot::SetPointSizes方法代码示例

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


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

示例1: array

# Testing phplot - Points
require_once 'phplot.php';
# This array is used for both the point shapes and legend:
$shapes = array('circle', 'cross', 'diamond', 'dot', 'halfline', 'line', 'plus', 'rect', 'triangle', 'trianglemid');
# 10 lines, one for each shape:
$data = array(array('', 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10), array('', 2, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11), array('', 3, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12), array('', 4, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13), array('', 5, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14), array('', 6, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15), array('', 7, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16), array('', 8, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17), array('', 9, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18), array('', 10, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19));
$p = new PHPlot();
$p->SetTitle('Points plots, 10 lines/10 shapes');
$p->SetDataType('data-data');
$p->SetDataValues($data);
# We don't use the data labels (all set to '') so might as well turn them off:
$p->SetXDataLabelPos('none');
# Need to set area and ticks to get reasonable choices.
#  Increase X range to make room for the legend.
$p->SetPlotAreaWorld(0, 0, 13, 20);
$p->SetXTickIncrement(1);
$p->SetYTickIncrement(2);
# Need 10 different colors; defaults are not different:
$p->SetDataColors(array('red', 'green', 'blue', 'yellow', 'cyan', 'magenta', 'brown', 'lavender', 'pink', 'orange'));
# Show all 10 shapes:
$p->SetPointShapes($shapes);
# Also show that as the legend:
$p->SetLegend($shapes);
# Make the points bigger so we can see them:
$p->SetPointSizes(10);
# Draw both grids:
$p->SetDrawXGrid(True);
$p->SetDrawYGrid(True);
# The default
$p->SetPlotType('points');
$p->DrawGraph();
开发者ID:myfarms,项目名称:PHPlot,代码行数:31,代码来源:point-shapes.php

示例2: array

}
# The variable $plot_type can be set in another script as well.
if (empty($plot_type)) {
    $plot_type = 'linepoints';
}
# Use data labels to display only the points we want,
# but specify the same values for X to get the correct
# spacing.
$data = array(array('1990', 1990, 41308, 21015, 62634), array('1995', 1995, 44310, 13883, 61529), array('2000', 2000, 46772, 9000, 59421), array('2004', 2004, 46887, 7738, 57754), array('2006', 2006, 45441, 6888, 53179), array('2008', 2008, 42757, 5840, 49115));
$legend_text = array('Morning Papers', 'Evening Papers', 'Sunday Papers');
$plot = new PHPlot(800, 600);
$plot->SetImageBorderType('plain');
// Improves presentation in the manual
$plot->SetTitle("US Daily Newspaper Circulation\n" . $plot_type . ' plot with SetLegendUseShapes(' . ($use_shapes ? 'True' : 'False') . ')');
$plot->SetPlotType($plot_type);
$plot->SetDataType('data-data');
$plot->SetDataValues($data);
$plot->SetPlotAreaWorld(1988, 0, 2010, 80000);
$plot->SetYTickIncrement(10000);
$plot->SetLegend($legend_text);
$plot->SetXTickPos('none');
$plot->SetDrawXDataLabelLines(True);
$plot->SetLegendUseShapes($use_shapes);
// Use color boxes or shapes
$plot->SetPointSizes(12);
// Make points bigger for visibility
$plot->SetLineStyles('solid');
// Make all lines solid
$plot->SetLineWidths(2);
// Make all lines thicker
$plot->DrawGraph();
开发者ID:myfarms,项目名称:PHPlot,代码行数:31,代码来源:legendshape.php

示例3: array

<?php

# PHPlot Example: Point chart with error bars
require_once 'phplot.php';
$data = array(array('', 1, 23.5, 5, 5), array('', 2, 20.1, 3, 3), array('', 3, 19.1, 2, 2), array('', 4, 16.8, 3, 3), array('', 5, 18.4, 4, 6), array('', 6, 20.5, 3, 2), array('', 7, 23.2, 4, 4), array('', 8, 23.1, 5, 2), array('', 9, 24.5, 2, 2), array('', 10, 28.1, 2, 2));
$plot = new PHPlot(800, 600);
$plot->SetImageBorderType('plain');
$plot->SetPlotType('points');
$plot->SetDataType('data-data-error');
$plot->SetDataValues($data);
# Main plot title:
$plot->SetTitle('Points Plot With Error Bars');
# Set data range and tick increments to get nice even numbers:
$plot->SetPlotAreaWorld(0, 0, 11, 40);
$plot->SetXTickIncrement(1);
$plot->SetYTickIncrement(5);
# Draw both grids:
$plot->SetDrawXGrid(True);
$plot->SetDrawYGrid(True);
# Is default
# Set some options for error bars:
$plot->SetErrorBarShape('tee');
# Is default
$plot->SetErrorBarSize(10);
$plot->SetErrorBarLineWidth(2);
# Use a darker color for the plot:
$plot->SetDataColors('brown');
$plot->SetErrorBarColors('brown');
# Make the points bigger so we can see them:
$plot->SetPointSizes(10);
$plot->DrawGraph();
开发者ID:myfarms,项目名称:PHPlot,代码行数:31,代码来源:points1.php

示例4: guifi_stats_chart05


//.........这里部分代码省略.........
                } else {
                    $tot = $record->num;
                }
                $tot2 = fmediacalc($tot, $datos, $n, $nmonths);
                $data[] = array("{$label}", $nreg, $tot2);
                if (floor($tot2) > $max) {
                    $max = floor($tot2);
                }
                if ($mes == 12) {
                    $mes = 1;
                    $ano++;
                } else {
                    $mes++;
                }
            }
            $tot += $record->num;
            $nreg++;
            if ($mes == 6) {
                $label = $ano;
            } else {
                $label = '';
            }
            if ($n == 0) {
                $tot += $record->num;
            } else {
                $tot = $record->num;
            }
            $tot2 = fmediacalc($tot, $datos, $n, $nmonths);
            $data[] = array("{$label}", $nreg, $tot2);
            if (floor($tot2) > $max) {
                $max = floor($tot2);
            }
        } else {
            $tot += $record->num;
        }
    }
    while ($mes < 12) {
        $nreg++;
        $mes++;
        if ($mes == 6) {
            $label = $ano;
        } else {
            $label = '';
        }
        $data[] = array("{$label}", $nreg, "");
    }
    if ($tot <= 10) {
        $inc = 1;
    } else {
        $vlen = strlen($max);
        $vini = substr($max, 0, 1);
        $inc = str_pad($vini, $vlen - 1, "0");
    }
    $items = ($ano - $items + 1) * 12;
    $shapes = array('none');
    $plot = new PHPlot($gwidth, $gheight);
    $plot->SetPlotAreaWorld(0, 0, $items, NULL);
    $plot->SetFileFormat('png');
    $plot->SetDataType("data-data");
    $plot->SetDataValues($data);
    $plot->SetPlotType("linepoints");
    $plot->SetYTickIncrement($inc);
    $plot->SetXTickIncrement(12);
    $plot->SetSkipBottomTick(TRUE);
    $plot->SetSkipLeftTick(TRUE);
    $plot->SetXAxisPosition(0);
    $plot->SetPointShapes($shapes);
    $plot->SetPointSizes(10);
    $plot->SetTickLength(3);
    $plot->SetDrawXGrid(TRUE);
    $plot->SetTickColor('grey');
    $plot->SetTTFPath($gDirTTFfonts);
    $plot->SetFontTTF('title', 'Vera.ttf', 12);
    if (isset($_GET['title'])) {
        $plot->SetTitle("guifi.net      \n" . t($_GET['title']));
    } else {
        if ($zone_id == "0") {
            $plot->SetTitle("guifi.net      \n" . t('Nodes per month, ' . "{$nmonths}" . ' months average'));
        } else {
            $plot->SetTitle("guifi.net    " . t('zone') . ": " . guifi_get_zone_name($zone_id) . "\n" . t('Nodes per month, ' . "{$nmonths}" . ' months average'));
        }
    }
    $plot->SetXTitle(t('Years'));
    $plot->SetYTitle(t('Working nodes'));
    $plot->SetDrawXDataLabelLines(FALSE);
    $plot->SetXLabelAngle(0);
    $plot->SetXLabelType('custom', 'guifi_stats_chart05_LabelFormat');
    $plot->SetGridColor('red');
    $plot->SetPlotBorderType('left');
    $plot->SetDataColors(array('orange'));
    $plot->SetTextColor('DimGrey');
    $plot->SetTitleColor('DimGrey');
    $plot->SetLightGridColor('grey');
    $plot->SetBackgroundColor('white');
    $plot->SetTransparentColor('white');
    $plot->SetXTickLabelPos('none');
    $plot->SetXDataLabelPos('plotdown');
    $plot->SetIsInline(TRUE);
    $plot->DrawGraph();
}
开发者ID:itorres,项目名称:drupal-guifi,代码行数:101,代码来源:guifi_stats.inc.php

示例5:

$p->SetLegend($legend);
$p->SetDataType('data-data');
$p->SetDataValues($data);
$p->SetPlotType($plottype);
$p->SetPlotAreaWorld(0, 0, 5, 10);
$p->SetXDataLabelPos('none');
$p->SetXTickIncrement(1.0);
$p->SetYTickIncrement(1.0);
# Option: Use legend shape markers?
$p->SetLegendUseShapes($useshapes);
# Option: Use TT Font, set size and optional line spacing scale:
if (!empty($fontsize)) {
    $p->SetFontTTF('legend', $font, $fontsize, $linespacing);
}
# Option: Varying point shape sizes:
if ($setpointsizes) {
    $p->SetPointSizes(array(2, 4, 8, 10, 16));
}
# Turn on backgrounds for visibility.
$p->SetBackgroundColor('SkyBlue');
$p->SetDrawPlotAreaBackground(True);
$p->SetPlotBgColor('plum');
# Option: Change alignment of lines/color boxes in legend?
if (isset($textalign)) {
    $p->SetLegendStyle($textalign, $colorboxalign);
}
# Opton: Scale factor for color box width?
if (isset($colorboxwidth)) {
    $p->legend_colorbox_width = $colorboxwidth;
}
$p->DrawGraph();
开发者ID:myfarms,项目名称:PHPlot,代码行数:31,代码来源:legshape.php

示例6: plot_guifi

function plot_guifi()
{
    include drupal_get_path('module', 'guifi') . '/contrib/phplot/phplot.php';
    $result = db_query("select COUNT(*) as num, MONTH(FROM_UNIXTIME(timestamp_created)) as mes, YEAR(FROM_UNIXTIME(timestamp_created)) as ano from {guifi_location} where status_flag='Working' GROUP BY YEAR(FROM_UNIXTIME(timestamp_created)),MONTH(FROM_UNIXTIME(timestamp_created)) ");
    $inicial = 5;
    $nreg = $inicial;
    $tot = 0;
    $ano = 2004;
    $mes = 5;
    $items = 2004;
    $label = "";
    while ($record = db_fetch_object($result)) {
        if ($record->ano >= 2004) {
            if ($mes == 12) {
                $mes = 1;
                $ano++;
            } else {
                $mes++;
            }
            while ($ano < $record->ano || $mes < $record->mes) {
                $nreg++;
                if ($mes == 6) {
                    $label = $ano;
                } else {
                    $label = '';
                }
                $data[] = array("{$label}", $nreg, $tot, '');
                if ($mes == 12) {
                    $mes = 1;
                    $ano++;
                } else {
                    $mes++;
                }
            }
            $tot += $record->num;
            $nreg++;
            if ($mes == 6) {
                $label = $ano;
            } else {
                $label = '';
            }
            $data[] = array("{$label}", $nreg, $tot, '');
        } else {
            $tot += $record->num;
        }
    }
    while ($mes < 12) {
        $nreg++;
        $mes++;
        if ($mes == 6) {
            $label = $ano;
        } else {
            $label = '';
        }
        $data[] = array("{$label}", $nreg, "");
    }
    $items = ($ano - $items + 1) * 12;
    if ($tot % 1000 < 30) {
        $data[$nreg - $inicial - 1][3] = $tot;
        $vt = floor($tot / 1000) * 1000;
        $vtitle = $vt . " " . t('Nodes') . "!!!";
        $tcolor = 'red';
    } else {
        $vtitle = t('Working nodes');
        $tcolor = 'DimGrey';
    }
    $shapes = array('none', 'circle');
    $plot = new PHPlot(200, 150);
    $plot->SetPlotAreaWorld(0, 0, $items, NULL);
    $plot->SetFileFormat('png');
    $plot->SetDataType("data-data");
    $plot->SetDataValues($data);
    $plot->SetPlotType("linepoints");
    $plot->SetYTickIncrement(2000);
    $plot->SetXTickIncrement(12);
    $plot->SetSkipBottomTick(TRUE);
    $plot->SetSkipLeftTick(TRUE);
    $plot->SetXAxisPosition(0);
    $plot->SetPointShapes($shapes);
    $plot->SetPointSizes(10);
    $plot->SetTickLength(3);
    $plot->SetDrawXGrid(TRUE);
    $plot->SetTickColor('grey');
    $plot->SetTitle($vtitle);
    $plot->SetDrawXDataLabelLines(FALSE);
    $plot->SetXLabelAngle(0);
    $plot->SetXLabelType('custom', 'Plot1_LabelFormat');
    $plot->SetGridColor('red');
    $plot->SetPlotBorderType('left');
    $plot->SetDataColors(array('orange'));
    $plot->SetTextColor('DimGrey');
    $plot->SetTitleColor($tcolor);
    $plot->SetLightGridColor('grey');
    $plot->SetBackgroundColor('white');
    $plot->SetTransparentColor('white');
    $plot->SetXTickLabelPos('none');
    $plot->SetXDataLabelPos('plotdown');
    $plot->SetIsInline(TRUE);
    $plot->DrawGraph();
}
开发者ID:itorres,项目名称:drupal-guifi,代码行数:100,代码来源:guifi_cnml.inc.php

示例7: array

        # Case: 1 point_size, 1 point_shape
        $point_shapes = 'dot';
        $point_sizes = 12;
        break;
    case 1:
        # Case: N>1 point_size, N point_shape
        $point_shapes = array('dot', 'box');
        $point_sizes = array(6, 12);
        break;
    case 2:
        # Case: N point_size, >N point_shape
        $point_shapes = array('dot', 'box');
        $point_sizes = 12;
        break;
    case 3:
        # Case: N point_size, <N point_shape
        $point_shapes = 'dot';
        $point_sizes = array(6, 12);
        break;
}
$data = array(array('', 0, 1, 2, 3), array('', 1, 2, 3, 4), array('', 2, 3, 4, 5));
$p = new PHPlot(600, 400);
$p->SetTitle("Point Sizes/Shapes (Bug 2963757) - case {$case}");
$p->SetDataType('data-data');
$p->SetDataValues($data);
$p->SetLineWidths(3);
$p->SetLineStyles('solid');
$p->SetPointShapes($point_shapes);
$p->SetPointSizes($point_sizes);
$p->SetPlotType('linepoints');
$p->DrawGraph();
开发者ID:myfarms,项目名称:PHPlot,代码行数:31,代码来源:pointcountbug.php

示例8: SetLegendTextColor

    echo "Skipping test because it requires SetLegendTextColor()\n";
    exit(2);
    // Tells test suite to skip this test
}
$title = 'Legend Text & Background Color Control (' . ($use_shapes ? 'marker shapes' : 'color boxes') . ')' . "\n" . "\nImage background color: " . ifset($image_bg_color) . "\nPlot area background color: " . ifset($plot_bg_color) . "\nLegend background color: " . ifset($legend_bg_color) . "\nLegend text color: " . ifset($legend_text_color) . "\nGeneral text color: " . ifset($text_color);
$data = array(array('', 1, 1, 2, 3, 4, 5), array('', 2, 5, 1, 2, 3, 4), array('', 3, 4, 5, 1, 2, 3), array('', 4, 3, 4, 5, 1, 2), array('', 5, 2, 3, 4, 5, 1));
# Random legend lines, different lengths
$legend = array('Data set 1', 'Data set 2', 'Error', 'Difference', 'Alternate');
$p = new PHPlot(800, 600);
$p->SetTitle($title);
$p->SetDataType('data-data');
$p->SetDataValues($data);
$p->SetPlotType('points');
$p->SetLegend($legend);
$p->SetPlotAreaWorld(0, 0, 6, 6);
$p->SetPointSizes(8);
# Wide left margin, leaving room for legend:
$p->SetMarginsPixels(200);
# Put the legend to the left of plot area, starting about 1/4 down:
$p->SetLegendPosition(1, 0, 'plot', -0.1, 0.25);
# Colors:
if (!empty($image_bg_color)) {
    $p->SetBackgroundColor($image_bg_color);
}
if (!empty($plot_bg_color)) {
    $p->SetPlotBgColor($plot_bg_color);
    $p->SetDrawPlotAreaBackground(True);
}
if (!empty($legend_bg_color)) {
    $p->SetLegendBgColor($legend_bg_color);
}
开发者ID:myfarms,项目名称:PHPlot,代码行数:31,代码来源:legendtxbgcolor.php


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