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


PHP Google_Config::setProperty方法代码示例

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


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

示例1:

<?php

include_once 'Google.merge.v_1_0.php';
// main
$v = new Google_Visualization("Table_Format");
// config
$c = new Google_Config("Table");
$c->setProperty("allowHtml", true);
// format
$f = Google_Format::factory("Bar");
$f->min = -10000;
$f->max = 10000;
$f->drawZeroLine = true;
$f->colorNegative = 'red';
$f->showValue = false;
$f->width = 250;
$f->format("data", 1);
$c->setProperty("showRowNumber", true);
// data
$o = new Google_Data_Base();
$o->addColumn("0", "Country", "string");
$o->addColumn("1", "Sales", "number");
$o->addColumn("2", "Expenses", "number");
$o->addNewRow();
$o->addStringCellToRow("US");
$o->addNumberCellToRow(10000);
$o->addNumberCellToRow(8000);
$o->addNewRow();
$o->addStringCellToRow("CA");
$o->addNumberCellToRow(-7000);
$o->addNumberCellToRow(5000);
开发者ID:scaphare,项目名称:QGoogleVisualizationAPI,代码行数:31,代码来源:sample_table_color_bar.php

示例2:

<?php

include_once 'Google.merge.v_1_0.php';
$v = new Google_Visualization("Table");
$c = new Google_Config("Table");
$c->setProperty("showRowNumber", true);
// data
$o = new Google_Data_Base();
$o->addColumn("0", "Country", "string");
$o->addColumn("1", "Sales", "number");
$o->addColumn("2", "Expenses", "number");
$o->addNewRow();
$o->addStringCellToRow("US");
$o->addNumberCellToRow(10000, "400.0");
$o->addNumberCellToRow(8000, "400.0");
$o->addNewRow();
$o->addStringCellToRow("CA");
$o->addNumberCellToRow(7000, "400.0");
$o->addNumberCellToRow(5000, "400.0");
$o->addNewRow();
$o->addStringCellToRow("CN");
$o->addNumberCellToRow(8000, "400.0");
$o->addNumberCellToRow(12000, "400.0");
$o->addNewRow();
$o->addStringCellToRow("UK");
$o->addNumberCellToRow(7000, "400.0");
$o->addNumberCellToRow(15000, "400.0");
$v->setConfig($c);
$v->setData($o);
?>
<html>
开发者ID:scaphare,项目名称:QGoogleVisualizationAPI,代码行数:31,代码来源:sample_table_merge.php

示例3:

<?php

include_once 'Google.merge.v_1_0.php';
$c = new Google_Config("AreaChart", "My Title");
$c->setProperty("width", 300);
$c->setProperty("height", 200);
$v = new Google_Visualization();
$c = new Google_Config("AreaChart");
// data
$o = Google_Data::getInstance()->getDataObject();
$o->addColumn("0", "Country", "string");
$o->addColumn("1", "Sales", "number");
$o->addColumn("1", "Expenses", "number");
$o->addNewRow();
$o->addStringCellToRow("US");
$o->addNumberCellToRow(10000, "400.0");
$o->addNumberCellToRow(8000, "400.0");
$o->addNewRow();
$o->addStringCellToRow("CA");
$o->addNumberCellToRow(7000, "400.0");
$o->addNumberCellToRow(5000, "400.0");
$o->addNewRow();
$o->addStringCellToRow("CN");
$o->addNumberCellToRow(8000, "400.0");
$o->addNumberCellToRow(12000, "400.0");
$o->addNewRow();
$o->addStringCellToRow("UK");
$o->addNumberCellToRow(7000, "400.0");
$o->addNumberCellToRow(15000, "400.0");
$v->setConfig($c);
$v->setData($o);
开发者ID:scaphare,项目名称:QGoogleVisualizationAPI,代码行数:31,代码来源:sample_bar.php

示例4:

<?php

include_once '../config.inc.php';
$v = new Google_Visualization("Gauge");
$c = new Google_Config("Gauge");
$o = new Google_Data_Base();
// config
$c->defaultConfig("MyTestGauge");
$c->setProperty("min", 0);
$c->setProperty("max", 280);
$c->setProperty("yellowFrom", 200);
$c->setProperty("yellowTo", 250);
$c->setProperty("redFrom", 250);
$c->setProperty("redTo", 280);
$c->setProperty("minorTicks", 5);
$v->setConfig($c);
// data
$o->addColumn("0", "Engine", "number");
$o->addColumn("1", "Torpedo", "number");
$o->addNewRow();
$o->addNumberCellToRow(120, "400.0");
$o->addNumberCellToRow(80, "400.0");
$v->setData($o);
?>
<html>
<head>
<?php 
echo $v->render();
?>
</head>
<body>
开发者ID:scaphare,项目名称:QGoogleVisualizationAPI,代码行数:31,代码来源:sample_gauge.php

示例5: array

} else {
    $chartType = 'AreaChart';
    $query = 'SELECT A,D WHERE D > 100 ORDER BY D';
}
$id = 'viz';
$url = 'http://spreadsheets.google.com/tq?key=pCQbetd-CptGXxxQIG7VFIQ&pub=1';
# new visualization using template default
$v = new Google_Visualization("Default");
# register package
$p = new Google_Package(array("packages" => array($chartType), "language" => "de_DE"));
$v->setPackage($p);
// set package object to visualization
# setup chart
$chart = new Google_Chart($chartType, Google_Base::getElementById($id));
$options = new Google_Config($chartType);
$options->setProperty("width", 550);
$chart->draw("data", $options);
# init functions
$f1 = new Google_Function('drawVisualization');
$f2 = new Google_Function('handleQueryResponse', array('response'));
# setup query
$q = new Google_Data_Query($url);
$q->setQuery($query);
$q->send($f2->getName());
$f1->add($q);
$f1->setCallBack();
$v->setFunction($f1);
# setup response
$qr = new Google_Data_QueryResponse();
$qr->asVar($chart->getDataTable())->getDataTable();
$f2->add($qr->render(true));
开发者ID:scaphare,项目名称:QGoogleVisualizationAPI,代码行数:31,代码来源:sample_multicharts.php


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