本文整理汇总了PHP中ProjectSettings::getChartRefreshTime方法的典型用法代码示例。如果您正苦于以下问题:PHP ProjectSettings::getChartRefreshTime方法的具体用法?PHP ProjectSettings::getChartRefreshTime怎么用?PHP ProjectSettings::getChartRefreshTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProjectSettings
的用法示例。
在下文中一共展示了ProjectSettings::getChartRefreshTime方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: xt_showchart
function xt_showchart($params)
{
$width = 700;
$height = 530;
$chartPreview = "";
if ($params["chartPreview"]) {
$chartPreview = "&chartPreview=true";
}
if (isset($params["custom1"])) {
$width = $params["custom1"];
}
if (isset($params["custom2"])) {
$height = $params["custom2"];
}
if ($params["dashResize"]) {
if ($params["dashWidth"] && $params["dashHeight"]) {
$width = $params["dashWidth"];
$height = $params["dashHeight"];
} elseif ($params["dashWidth"]) {
$height = round($height * $params["dashWidth"] / $width);
$width = $params["dashWidth"];
} elseif ($params["dashHeight"]) {
$width = round($width * $params["dashHeight"] / $height);
$height = $params["dashHeight"];
}
// adjust the chart size to fit it in the dash cell
$width *= 0.95;
$height *= 0.95;
} elseif ($params["resize"]) {
$maxWidth = 400;
$maxHeight = 280;
$r = $maxWidth / $maxHeight;
$r2 = $width / $height;
if ($width > $maxWidth || $height > $maxHeight) {
if ($r2 >= $r) {
// width
$height = round($height * $maxWidth / $width);
$width = $maxWidth;
} else {
$width = round($width * $maxHeight / $height);
$height = $maxHeight;
}
}
}
$showDetails = isset($params["showDetails"]) ? $params["showDetails"] : true;
$settings = new ProjectSettings(GetTableByShort($params["chartname"]));
$refresh = $settings->getChartRefreshTime() * 1000;
if ($_SERVER["SERVER_PORT"] == 443) {
$http = "https";
} else {
$http = "http";
}
?>
<div id='<?php
echo $params["chartname"] . $params["id"];
?>
' style="width:<?php
echo $width;
?>
px;height:<?php
echo $height;
?>
px">
<?php
if (!$params["singlePage"]) {
?>
<script type="text/javascript" language="javascript" src="libs/js/AnyChart.js"></script>
<script type="text/javascript" language="javascript" src="libs/js/AnyChartHTML5.js"></script>
<script type="text/javascript">
<?php
global $useFlashChartLibrary;
if (!$useFlashChartLibrary) {
?>
var svgSupported = !!document.createElementNS && !!document.createElementNS('http://www.w3.org/2000/svg', 'svg').createSVGRect;
AnyChart.renderingType = svgSupported ? anychart.RenderingType.SVG_PREFERRED : anychart.RenderingType.FLASH_PREFERRED;
<?php
} else {
?>
AnyChart.renderingType = anychart.RenderingType.FLASH_PREFERRED;
<?php
}
?>
</script>
<script type="text/javascript" language="javascript">
//<![CDATA[
var chart = new AnyChart('libs/swf/AnyChart.swf','libs/swf/Preloader.swf');
chart.width = '<?php
echo $width;
?>
';
chart.height = '<?php
echo $height;
?>
';
chart.wMode='opaque';
chart.id = 'chart_' + '<?php
echo $params["chartname"];
?>
//.........这里部分代码省略.........
示例2: xt_showchart
function xt_showchart($params)
{
$width = 700;
$height = 530;
if (isset($params["custom1"])) {
$width = $params["custom1"];
}
if (isset($params["custom2"])) {
$height = $params["custom2"];
}
$settings = new ProjectSettings(GetTableByShort($params["chartname"]));
$refresh = $settings->getChartRefreshTime() * 60000;
if ($_SERVER["SERVER_PORT"] == 443) {
$http = "https";
} else {
$http = "http";
}
?>
<div id='<?php
echo $params["chartname"];
?>
' style="width:<?php
echo $width;
?>
px;height:<?php
echo $height;
?>
px">
<noscript>
<object id="'.htmlspecialchars(postvalue('cname')).'"
name="'.htmlspecialchars(postvalue('cname')).'"
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
width="100%"
height="100%"
codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
<param name="movie" value="libs/swf/Preloader.swf" />
<param name="bgcolor" value="#FFFFFF" />
<param name="allowScriptAccess" value="always" />
<param name="flashvars" value="swfFile=dchartdata.php%3Fcname%3D'.htmlspecialchars(postvalue('cname')).'%26ctype%3D'.$chrt_array['chart_type']['type'].'" />
<embed type="application/x-shockwave-flash"
pluginspage="http://www.adobe.com/go/getflashplayer"
src="libs/swf/Preloader.swf"
width="100%"
height="100%"
id="'.htmlspecialchars(postvalue('cname')).'"
name="'.htmlspecialchars(postvalue('cname')).'"
bgColor="#FFFFFF"
allowScriptAccess="always"
flashvars="swfFile=dchartdata.php%3Fcname%3D'.htmlspecialchars(postvalue('cname')).'%26ctype%3D'.$chrt_array['chart_type']['type'].'" />
</object>
</noscript>
<script type="text/javascript" language="javascript" src="libs/js/AnyChart.js"></script>
<script type="text/javascript" language="javascript" src="libs/js/AnyChartHTML5.js"></script>
<script type="text/javascript">
AnyChart.renderingType = anychart.RenderingType.FLASH_PREFERRED;
var svgSupported = window.SVGAngle != undefined;
if (!svgSupported)
{
//<![CDATA[
document.write('<center>');
document.write("You need to have Adobe Flash Player 9 (or above) to view the chart.<br /><br />");
document.write("<a href=\"<?php
echo $http;
?>
://www.adobe.com/go/getflashplayer\"><img border=\"0\" src=\"<?php
echo $http;
?>
://www.adobe.com/images/shared/download_buttons/get_flash_player.gif\" /></a><br />");
document.write('</center>');
//]]>
}
</script>
<script type="text/javascript" language="javascript">
//<![CDATA[
var chart = new AnyChart('libs/swf/AnyChart.swf','libs/swf/Preloader.swf');
chart.width = '<?php
echo $width;
?>
';
chart.height = '<?php
echo $height;
?>
';
chart.wMode='opaque';
chart.id = 'chart_' + '<?php
echo $params["chartname"];
?>
';
var xmlFile = 'dchartdata.php?chartname=<?php
echo jsreplace($params["chartname"]);
?>
';
xmlFile += '&ctype=<?php
echo $params["ctype"];
?>
';
chart.setXMLFile(xmlFile);
//.........这里部分代码省略.........
示例3: xt_showchart
function xt_showchart($params)
{
$width=700;
$height=530;
$chartPreview = "";
if($params["chartPreview"])
$chartPreview = "&chartPreview=true";
if(isset($params["custom1"]))
$width=$params["custom1"];
if(isset($params["custom2"]))
$height=$params["custom2"];
if ($params["resize"])
{
$maxWidth = 400;
$maxHeight = 280;
$r = $maxWidth / $maxHeight;
$r2 = $width / $height;
if (($width > $maxWidth) || ($height > $maxHeight))
{
if ($r2 >= $r)
{ // width
$height = round( $height * $maxWidth / $width );
$width = $maxWidth;
}
else
{
$width = round ( $width * $maxHeight / $height );
$height = $maxHeight;
}
}
}
$showDetails = isset( $params["showDetails"] ) ? $params["showDetails"] : true;
$settings = new ProjectSettings(GetTableByShort($params["chartname"]));
$refresh = $settings->getChartRefreshTime()*60000;
if ($_SERVER["SERVER_PORT"]==443)
$http = "https";
else
$http="http";
?>
<div id='<?php echo $params["chartname"].$params["id"] ?>' style="width:<?php echo $width; ?>px;height:<?php echo $height; ?>px">
<?php if (!$params["singlePage"]) { ?>
<script type="text/javascript" language="javascript" src="libs/js/AnyChart.js"></script>
<script type="text/javascript" language="javascript" src="libs/js/AnyChartHTML5.js"></script>
<script type="text/javascript">
<?php global $useFlashChartLibrary; if (!$useFlashChartLibrary) { ?>
var svgSupported = !!document.createElementNS && !!document.createElementNS('http://www.w3.org/2000/svg', 'svg').createSVGRect;
AnyChart.renderingType = svgSupported ? anychart.RenderingType.SVG_PREFERRED : anychart.RenderingType.FLASH_PREFERRED;
<?php } else { ?>
AnyChart.renderingType = anychart.RenderingType.FLASH_PREFERRED;
<?php } ?>
</script>
<script type="text/javascript" language="javascript">
//<![CDATA[
var chart = new AnyChart('libs/swf/AnyChart.swf','libs/swf/Preloader.swf');
chart.width = '<?php echo $width; ?>';
chart.height = '<?php echo $height; ?>';
chart.wMode='opaque';
chart.id = 'chart_' + '<?php echo $params["chartname"];?>';
var xmlFile = '<?php echo GetTableLink("dchartdata")?>?chartname=<?php echo jsreplace($params["chartname"]).$chartPreview;?>';
xmlFile += '&ctype=<?php echo $params["ctype"];?>';
xmlFile += '&showDetails=<?php echo $showDetails;?>';
xmlFile += '&hasFlash=' + AnyChart.platform.hasRequiredVersion;
chart.setXMLFile(xmlFile);
chart.write('<?php echo $params["chartname"].$params["id"];?>');
<?php
$chartname = jsreplace($params["chartname"]);
if($params["ctype"]=="Gauge")
$refrFunction="Runner.updateGaugeChart(\'".$chartname."\')";
else
$refrFunction="Runner.updateChart(\'".$chartname."\', ".($showDetails ? "true" : "false").")";
if(!$useFlashChartLibrary && ( $params["ctype"]=="2DPie" || $params["ctype"]=="2DDoughnut" || $params["ctype"]=="Funnel" || $params["ctype"]=="OHLC" || $params["ctype"]=="Candle" ))
$refresh="0";
if($refresh!="0" && !isMobile())
echo "setInterval('".$refrFunction."',".$refresh.");";
?>
//]]>
</script>
<?php } ?>
</div>
<?php
}