* delete unused code.
This commit is contained in:
@@ -13,258 +13,6 @@
|
||||
<?php
|
||||
class reportModel extends model
|
||||
{
|
||||
/**
|
||||
* Create the html code of chart.
|
||||
*
|
||||
* @param string $swf the swf type
|
||||
* @param string $dataURL the date url
|
||||
* @param int $width
|
||||
* @param int $height
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function createChart($swf, $dataURL, $width = 800, $height = 500)
|
||||
{
|
||||
$chartRoot = $this->app->getWebRoot() . 'fusioncharts/';
|
||||
$swfFile = "fcf_$swf.swf";
|
||||
return <<<EOT
|
||||
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="$width" height="$height" id="fcf$swf" >
|
||||
<param name="movie" value="$chartRoot$swfFile" />
|
||||
<param name="FlashVars" value="&dataURL=$dataURL&chartWidth=$width&chartHeight=$height">
|
||||
<param name="quality" value="high" />
|
||||
<param name="wmode" value="Opaque">
|
||||
<embed src="$chartRoot$swfFile" flashVars="&dataURL=$dataURL&chartWidth=$width&chartHeight=$height" quality="high" wmode="Opaque" width="$width" height="$height" name="fcf$swf" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
|
||||
</object>
|
||||
EOT;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the js code of chart.
|
||||
*
|
||||
* @param string $swf the swf type
|
||||
* @param string $dataURL the date url
|
||||
* @param int $width
|
||||
* @param int $height
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function createJSChart($swf, $dataXML, $width = 'auto', $height = 500)
|
||||
{
|
||||
$jsRoot = $this->app->getWebRoot() . 'js/';
|
||||
static $count = 0;
|
||||
$count ++;
|
||||
$chartRoot = $this->app->getWebRoot() . 'fusioncharts/';
|
||||
$swfFile = "fcf_$swf.swf";
|
||||
$divID = "chart{$count}div";
|
||||
$chartID = "chart{$count}";
|
||||
|
||||
$js = '';
|
||||
if($count == 1) $js = "<script language='Javascript' src='{$jsRoot}misc/fusioncharts.js'></script>";
|
||||
return <<<EOT
|
||||
$js
|
||||
<div id="$divID" class='chartDiv'></div>
|
||||
<script language="JavaScript">
|
||||
function createChart$count()
|
||||
{
|
||||
chartWidth = "$width";
|
||||
if(chartWidth == 'auto') chartWidth = $('#$divID').width() - 10;
|
||||
if(chartWidth < 300) chartWidth = 300;
|
||||
var $chartID = new FusionCharts("$chartRoot$swfFile", "{$chartID}id", chartWidth, "$height");
|
||||
$chartID.setDataXML("$dataXML");
|
||||
$chartID.render("$divID");
|
||||
}
|
||||
</script>
|
||||
EOT;
|
||||
}
|
||||
|
||||
public function createJSChartFlot($projectName, $flotJSON, $width = 'auto', $height = 500)
|
||||
{
|
||||
$this->app->loadLang('project');
|
||||
$jsRoot = $this->app->getWebRoot() . 'js/';
|
||||
$width = $width . 'px';
|
||||
$height = $height . 'px';
|
||||
|
||||
$dataJSON = $flotJSON['data'];
|
||||
$limitJSON = $flotJSON['limit'];
|
||||
$baselineJSON = $flotJSON['baseline'];
|
||||
$dateListJSON = $flotJSON['dateList'];
|
||||
$ticksJSON = $flotJSON['ticks'];
|
||||
return <<<EOT
|
||||
<!--[if lte IE 8]><script language="javascript" type="text/javascript" src="{$jsRoot}jquery/flot/excanvas.min.js"></script><![endif]-->
|
||||
<script language="javascript" type="text/javascript" src="{$jsRoot}jquery/flot/jquery.flot.min.js"></script>
|
||||
<div id="placeholder" style="width:$width;height:$height;margin:0 auto"></div>
|
||||
<script type="text/javascript">
|
||||
$(function ()
|
||||
{
|
||||
var data = $dataJSON;
|
||||
var limit = $limitJSON;
|
||||
var baseline = $baselineJSON;
|
||||
var dateList = $dateListJSON;
|
||||
var ticks = $ticksJSON;
|
||||
var firstDay = 0;
|
||||
function showTooltip(x, y, contents)
|
||||
{
|
||||
$('<div id="tooltip">' + contents + '</div>').css
|
||||
({
|
||||
position: 'absolute',
|
||||
display: 'none',
|
||||
top: y + 5,
|
||||
left: x + 5,
|
||||
border: '1px solid #fdd',
|
||||
padding: '2px',
|
||||
'background-color': '#fee',
|
||||
opacity: 0.80
|
||||
}).appendTo("body").fadeIn(200);
|
||||
}
|
||||
|
||||
var options = {
|
||||
series: {lines:{show: true, lineWidth: 2}, points: {show: true},hoverable: true},
|
||||
legend: {noColumns: 1},
|
||||
grid: { hoverable: true, clickable: true },
|
||||
xaxis:
|
||||
{
|
||||
ticks:ticks,
|
||||
tickFormatter: function(val)
|
||||
{
|
||||
tick = new Date(dateList[val]);
|
||||
if(dateList[val] != undefined)
|
||||
{
|
||||
var month = tick.getMonth() + 1;
|
||||
var dateTail = '';
|
||||
if(firstDay != month)
|
||||
{
|
||||
dateTail = '/' + month;
|
||||
firstDay = month;
|
||||
}
|
||||
|
||||
if(config.clientLang == 'en')
|
||||
{
|
||||
title = month + '/' + tick.getDate() + '/' + tick.getFullYear();
|
||||
}
|
||||
else
|
||||
{
|
||||
title = tick.getFullYear() + '/' + month + '/' + tick.getDate();
|
||||
}
|
||||
|
||||
if(ticks.length <= 30) dateTail = '/' + month;
|
||||
return '<span title="' + title + '">' + tick.getDate() + dateTail + '</span>';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
yaxis: {mode: null, min: 0, minTickSize: [1, "day"]}};
|
||||
|
||||
var placeholder = $("#placeholder");
|
||||
$("#placeholder").bind("plotselected", function (event, ranges)
|
||||
{
|
||||
plot = $.plot(placeholder, data, $.extend(true, {}, options, {xaxis: { min: ranges.xaxis.from, max: ranges.xaxis.to } }));
|
||||
});
|
||||
var plot = $.plot(placeholder, [
|
||||
{
|
||||
data:data,
|
||||
color: "rgb(10, 12, 235)",
|
||||
lines: {show: true},
|
||||
points: {show: true}
|
||||
},
|
||||
{
|
||||
data:baseline,
|
||||
color: "rgb(235, 12, 10)",
|
||||
hoverable: false,
|
||||
lines: {show: true, lineWidth:0.5, lineType:'dashed', style:'dashed'},
|
||||
points: {show: false}
|
||||
},
|
||||
{
|
||||
data:limit,
|
||||
lines: {show: false},
|
||||
points: {show: false}
|
||||
}
|
||||
], options);
|
||||
var previousPoint = null;
|
||||
|
||||
placeholder.bind("plothover", function(event, pos, item)
|
||||
{
|
||||
$("#x").text(pos.x.toFixed(2));
|
||||
$("#y").text(pos.y.toFixed(2));
|
||||
|
||||
if (item)
|
||||
{
|
||||
if (previousPoint != item.dataIndex)
|
||||
{
|
||||
previousPoint = item.dataIndex;
|
||||
|
||||
$("#tooltip").remove();
|
||||
var x = item.datapoint[0].toFixed(2), y = item.datapoint[1].toFixed(2);
|
||||
|
||||
showTooltip(item.pageX, item.pageY, y);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<h1>$projectName {$this->lang->project->burn}</h1>
|
||||
EOT;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create xml data of single charts.
|
||||
*
|
||||
* @param array $sets
|
||||
* @param array $chartOptions
|
||||
* @param array $colors
|
||||
* @access public
|
||||
* @return string the xml data.
|
||||
*/
|
||||
public function createSingleXML($sets, $chartOptions = array(), $colors = array())
|
||||
{
|
||||
$data = pack("CCC", 0xef, 0xbb, 0xbf); // utf-8 bom.
|
||||
$data .="<?xml version='1.0' encoding='UTF-8'?>";
|
||||
|
||||
$data .= '<graph';
|
||||
foreach($chartOptions as $key => $value) $data .= " $key='$value'";
|
||||
$data .= ">";
|
||||
|
||||
if(empty($colors)) $colors = $this->lang->report->colors;
|
||||
$colorCount = count($colors);
|
||||
$i = 0;
|
||||
foreach($sets as $set)
|
||||
{
|
||||
if($i == $colorCount) $i = 0;
|
||||
$color = $colors[$i];
|
||||
$i ++;
|
||||
$data .= "<set name='$set->name' value='$set->value' color='$color' />";
|
||||
}
|
||||
$data .= "</graph>";
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function createSingleJSON($sets, $dateList)
|
||||
{
|
||||
$data = '[';
|
||||
foreach($dateList as $i => $date)
|
||||
{
|
||||
$date = date('Y-m-d', strtotime($date));
|
||||
if(isset($sets[$date]))$data .= "[$i, {$sets[$date]->value}],";
|
||||
}
|
||||
$data = rtrim($data, ',');
|
||||
$data .= ']';
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the js code to render chart.
|
||||
*
|
||||
* @param int $chartCount
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function renderJsCharts($chartCount)
|
||||
{
|
||||
$js = '<script language="Javascript">';
|
||||
for($i = 1; $i <= $chartCount; $i ++) $js .= "createChart$i()\n";
|
||||
$js .= '</script>';
|
||||
return $js;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compute percent of every item.
|
||||
*
|
||||
|
||||
@@ -1,106 +0,0 @@
|
||||
===========================**=====**=====**===============================
|
||||
|
||||
FusionCharts Free v2.2
|
||||
Released: Aug 2009
|
||||
http://www.fusioncharts.com/free
|
||||
|
||||
Copyright (c) 2009 InfoSoft Global (P) Ltd.
|
||||
www.infosoftglobal.com
|
||||
|
||||
Dual licensed under the MIT (X11) and GNU GPL licenses.
|
||||
http://www.fusioncharts.com/free/license
|
||||
|
||||
MIT License: http://www.opensource.org/licenses/mit-license.php
|
||||
GPL License: http://www.gnu.org/copyleft/gpl.html
|
||||
|
||||
===========================**=====**=====**===============================
|
||||
IMPORTANT NOTE:
|
||||
===========================**=====**=====**===============================
|
||||
|
||||
FusionCharts Free is not the evaluation of FusionCharts v3.
|
||||
|
||||
FusionCharts Free is an open-source Flash charting component which originally
|
||||
was FusionCharts v2.3. It is intended to take care of all your basic charting needs.
|
||||
FusionCharts v3, on the other hand, has a lot more features and chart types that
|
||||
you may see and download from http://www.fusioncharts.com
|
||||
|
||||
FusionCharts Free and FusionCharts v3 can both be used for personal or
|
||||
commercial purposes. However, if you have downloaded FusionCharts Free for
|
||||
evaluation purposes, we recommend that you download FusionCharts v3 evaluation
|
||||
from www.fusioncharts.com/download. This is because the feature set is more
|
||||
advanced in FusionCharts v3. Additionally, FusionCharts v3 provides
|
||||
seamless upgrade from all previous versions of FusionCharts, including
|
||||
FusionCharts Free.
|
||||
|
||||
===========================**=====**=====**===============================
|
||||
|
||||
How do I install?
|
||||
==================
|
||||
Please run Index.html to launch the documentation. Then, browse to
|
||||
"Installation" page to get instructions on how to install FusionCharts
|
||||
Free and use it in your projects.
|
||||
|
||||
I'm a non-technical user. How do I get started?
|
||||
===============================================
|
||||
If you wish to use FusionCharts Free with your presentations or static
|
||||
pages, please run Index.html and read through the pertinent section.
|
||||
|
||||
Or, if you're using Dreamweaver to create your websites, you might want to take
|
||||
a look at FusionCharts for Dreamweaver. It allows you to build charts from the Design
|
||||
View in Dreamweaver itself, without having to write even a line of code.
|
||||
Please visit www.fusioncharts.com/?Dreamweaver for more details.
|
||||
|
||||
I want to use FusionCharts Free in my blogs. How can I?
|
||||
================================================================
|
||||
If you're familiar with HTML and JavaScript, you can upload the SWF
|
||||
files to your blog and then build charts using HTML code (as explained
|
||||
in our documentation).
|
||||
|
||||
Or, if you're NOT comfortable with code, you may use FusionCharts
|
||||
Google Gadget for Free at www.fusioncharts.com/GG to build such charts
|
||||
for your blogs, without having to write a line of code.
|
||||
|
||||
Where can I get support on this?
|
||||
================================
|
||||
At this point in time, we do not provide personalized support for
|
||||
FusionCharts Free. However, you may visit our forums at
|
||||
www.fusioncharts.com/forum to get support from our vibrant community.
|
||||
|
||||
I've started using FusionCharts Free. Can I upgrade to FusionCharts v3?
|
||||
=======================================================================
|
||||
Yes - very much. FusionCharts v3 is totally backward compatible with
|
||||
FusionCharts Free. So all code that you've written with FusionCharts Free
|
||||
will work with FusionCharts v3. All you need to do is download/purchase
|
||||
FusionCharts v3 from www.fusioncharts.com and replace the old SWF files
|
||||
with new ones, and then rename either the SWF itself, or the file names in
|
||||
your code.
|
||||
|
||||
How can I build some of the advanced charts, gauges and maps that I
|
||||
see in your gallery at www.fusioncharts.com/gallery?
|
||||
=======================================================================
|
||||
To use advanced charts, gauges or maps as in our gallery, you will have to buy the apt
|
||||
license of our products. We offer 4 core products that provide different types of charts, gauges
|
||||
and maps:
|
||||
|
||||
- FusionCharts v3 at www.fusioncharts.com. Advanced version of FusionCharts
|
||||
with features like gradients, intelligent labels, export as image/PDF/CSV etc.
|
||||
- FusionWidgets v3 at www.fusioncharts.com/widgets for gauges, funnel/pyramid
|
||||
charts, sparklines, bullet graphs etc.
|
||||
- PowerCharts v3 at www.fusioncharts.com/PowerCharts for rich internet
|
||||
application charts for specialized domains
|
||||
- FusionMaps v3 at www.fusioncharts.com/maps for data-driven maps. FusionMaps
|
||||
offers over 550 maps including all continents, countries, US states and more.
|
||||
|
||||
I'm an Adobe Flex developer. Can I use FusionCharts Free in my projects?
|
||||
=======================================================================
|
||||
While you cannot use FusionCharts Free, you can use FusionCharts for Flex
|
||||
in your Adobe Flex solutions. Please see www.fusioncharts.com/flex
|
||||
|
||||
I'm a Visual Basic 6.0 Developer. Can I use FusionCharts Free in my projects?
|
||||
=======================================================================
|
||||
Yes you can, using Flash Player OCX. We also provide a robust API for the
|
||||
same at www.fusioncharts.com/VB
|
||||
|
||||
I'm a FileMaker Developer. Can I use FusionCharts Free in my projects?
|
||||
=======================================================================
|
||||
Yes - we have FusionCharts Free for FileMaker at www.fusioncharts.com/FileMaker
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user