<table><tr><td>
<?php 
// first phpChart with one series
$pc = new C_PhpChartX(array(array(null)), 'Graph');
$pc->set_axes(array('xaxis' => array('label' => 'Buy Price'), 'yaxis' => array('label' => '$')));
$pc->draw(600, 300);
?>
</td>
<td>
<?php 
// second phpChart with two series
$pc2 = new C_PhpChartX(array(array(null), array(null)), 'Graph2');
$pc2->add_plugins(array('CanvasTextRenderer', 'CanvasAxisTickRenderer'));
$pc2->set_series_default(array('renderer' => 'plugin::BarRenderer', 'rendererOptions' => array('barWidth' => 10, 'shadowOffset' => 3), 'shadow' => true));
$pc2->set_axes(array('xaxis' => array('label' => 'Buy Price/MSRP (by Product Code)'), 'yaxis' => array('label' => '$')));
$pc2->set_animate(true);
$pc2->set_legend(array('show' => true, 'location' => 'nw'));
$pc2->draw(600, 300);
?>
</td></tr></table>

<?php 
$dg = new C_DataGrid("SELECT * FROM products", "productCode", "products");
$dg->enable_edit('FORM');
$onGridLoadComplete = <<<ONGRIDLOADCOMPLETE
function(status, rowid)
{
\tvar GraphData1 = [];
\tvar GraphData2 = [];

\td1 = \$('#products').jqGrid('getCol', 'buyPrice', false);
示例#2
0
    <head>
	<title>phpChart - Min Max Lines</title>
    </head>
    <body>
        <div><span> </span><span id="info1b"></span></div>


<?php 
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//Chart 1 Example
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$line1 = array(array(1, 1), array(4, 2), array(9, 3), array(16, 4));
$line2 = array(array(25, 1), array(12.5, 2), array(6.25, 3), array(3.125, 4));
$min = array(array(2, 0.6), array(2, 4.4));
$max = array(array(15, 0.6), array(15, 4.4));
$pc = new C_PhpChartX(array($line1, $line2, $min, $max), 'chart1');
$pc->set_title(array('text' => 'Horizontally Oriented Bar Chart'));
$pc->set_animate(true);
$pc->add_series(array('label' => 'Cats', 'renderer' => 'plugin::BarRenderer', 'rendererOptions' => array('barDirection' => 'horizontal', 'barPadding' => 6, 'barMargin' => 15), 'shadowAngle' => 135));
$pc->add_series(array('label' => 'Dogs', 'renderer' => 'plugin::BarRenderer', 'rendererOptions' => array('barDirection' => 'horizontal', 'barPadding' => 6, 'barMargin' => 15), 'shadowAngle' => 135));
$pc->add_series(array('showMarker' => false, 'label' => 'min'));
$pc->add_series(array('showMarker' => false, 'label' => 'max'));
$pc->set_legend(array('show' => true, 'location' => 'ne'));
$pc->set_axes(array('xaxis' => array('min' => 0), 'yaxis' => array('renderer' => 'plugin::CategoryAxisRenderer', 'ticks' => array('Once', 'Twice', 'Three Times', 'More'))));
$pc->draw(800, 300);
?>

    </body>
</html>
$pc->add_series(array('renderer' => 'plugin::BarRenderer'));
//set axes
$pc->set_axes(array('xaxis' => array('renderer' => 'plugin::CategoryAxisRenderer', 'label' => 'Warranty Concern', 'tickOptions' => array('enableFontSupport' => true, 'angle' => -30), 'tickRenderer' => 'plugin::CanvasAxisTickRenderer'), 'yaxis' => array('autoscale' => true, 'label' => 'Occurance', 'tickOptions' => array('enableFontSupport' => true, 'angle' => -30), 'tickRenderer' => 'plugin::CanvasAxisTickRenderer')));
$pc->draw(800, 500);
echo '<br />';
echo '<br />';
echo '<br />';
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$line = array(array('Cup Holder Pinion Bob', 7), array('Generic Fog Lamp', 9), array('HDTV Receiver', 15), array('8 Track Control Module', 12), array(' Sludge Pump Fourier Modulator', 3), array('Transcender/Spice Rack', 6), array('Hair Spray Danger Indicator', 18));
$line2 = array(array('Nickle', 28), array('Aluminum', 13), array('Xenon', 54), array('Silver', 47), array('Sulfer', 16), array('Silicon', 14), array('Vanadium', 23));
$pc = new C_PhpChartX(array($line, $line2), 'chart_2');
$pc->add_plugins(array('canvasTextRenderer'));
//set animation
$pc->set_animate();
//set series
$pc->add_series(array('renderer' => 'plugin::BarRenderer'));
$pc->add_series(array('xaxis' => 'x2axis', 'yaxis' => 'y2axis'));
//set axes
$pc->set_axes(array('xaxis' => array('renderer' => 'plugin::CategoryAxisRenderer', 'label' => 'Warranty Concern', 'labelRenderer' => 'plugin::CanvasAxisLabelRenderer', 'tickOptions' => array('angle' => 30), 'tickRenderer' => 'plugin::CanvasAxisTickRenderer'), 'x2axis' => array('renderer' => 'plugin::CategoryAxisRenderer', 'label' => 'Metal', 'labelRenderer' => 'plugin::CanvasAxisLabelRenderer', 'tickOptions' => array('angle' => 30), 'tickRenderer' => 'plugin::CanvasAxisTickRenderer'), 'yaxis' => array('autoscale' => true, 'label' => 'Occurance', 'tickOptions' => array('angle' => 30), 'labelRenderer' => 'plugin::CanvasAxisLabelRenderer', 'tickRenderer' => 'plugin::CanvasAxisTickRenderer'), 'y2axis' => array('autoscale' => true, 'label' => 'Number', 'tickOptions' => array('angle' => 30), 'labelRenderer' => 'plugin::CanvasAxisLabelRenderer', 'tickRenderer' => 'plugin::CanvasAxisTickRenderer')));
$pc->draw(800, 600);
echo '<br />';
echo '<br />';
echo '<br />';
/*
	//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////