Плагины отдельно, чуть покрасивее сделал, пробелы расставил как надо (по 2)
parent
62a5c76d06
commit
3bb4c6adde
16
olap.php
16
olap.php
|
@ -222,6 +222,14 @@ class OLAP
|
|||
// Описание показателя
|
||||
foreach(array('field', 'func', 'aggr') as $x)
|
||||
$this->cell[$x] = $request["cell_$x"];
|
||||
$this->cell['field_name'] = $this->current_src['fielddescs'][$this->cell['field']]['name'];
|
||||
$this->cell['func_name'] = self::$functions[$this->cell['func']]['name'];
|
||||
$this->cell['aggr_name'] = self::$aggregates[$this->cell['aggr']]['name'];
|
||||
$this->cell['value_desc'] = $this->cell['field_name'];
|
||||
if ($this->cell['func_name'])
|
||||
$this->cell['value_desc'] = $this->cell['func_name'].'('.$this->cell['value_desc'].')';
|
||||
if ($this->cell['aggr_name'])
|
||||
$this->cell['value_desc'] = $this->cell['aggr_name'].': '.$this->cell['value_desc'];
|
||||
|
||||
// Запрос на построение?
|
||||
$this->build = !empty($request['build']);
|
||||
|
@ -528,6 +536,7 @@ class OLAP
|
|||
'data' => array(),
|
||||
'max' => NULL,
|
||||
'min' => NULL,
|
||||
'numeric' => true,
|
||||
);
|
||||
foreach ($keys as $k)
|
||||
{
|
||||
|
@ -542,7 +551,10 @@ class OLAP
|
|||
$v = -1-log(-$v);
|
||||
}
|
||||
$ov = str_replace('.00', '', sprintf("%.2f", $ov));
|
||||
$gr['data'][] = array($this->field_format($my['field'], '', '', $k), $ov, $v, 0);
|
||||
$fv = $this->field_format($my['field'], '', '', $k);
|
||||
if (!is_numeric($fv))
|
||||
$gr['numeric'] = false;
|
||||
$gr['data'][] = array($fv, $ov, $v, 0);
|
||||
if ($gr['max'] === NULL || $gr['max'] < $v)
|
||||
$gr['max'] = $v;
|
||||
if ($gr['min'] === NULL || $gr['min'] > $v)
|
||||
|
@ -1030,9 +1042,11 @@ class OLAP
|
|||
'full_desc' => $a,
|
||||
'changed_desc' => $b,
|
||||
'graphs' => array(),
|
||||
'numeric' => true,
|
||||
);
|
||||
}
|
||||
$group['graphs'][] = $graph;
|
||||
$group['numeric'] = $group['numeric'] && $graph['numeric'];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -3,7 +3,14 @@
|
|||
<script language="javascript" type="text/javascript" src="{DOMAIN}/tpldata/jquery.min.js"></script>
|
||||
<!--[if lte IE 8]><script language="javascript" type="text/javascript" src="{DOMAIN}/tpldata/excanvas.min.js"></script><![endif]-->
|
||||
<script language="javascript" type="text/javascript" src="{DOMAIN}/tpldata/jqplot.all.min.js"></script>
|
||||
<script language="javascript" type="text/javascript" src="{DOMAIN}/tpldata/jqplot.plugins.all.min.js"></script>
|
||||
<script language="javascript" type="text/javascript" src="{DOMAIN}/tpldata/jqplot.canvasTextRenderer.min.js"></script>
|
||||
<script language="javascript" type="text/javascript" src="{DOMAIN}/tpldata/jqplot.canvasAxisLabelRenderer.min.js"></script>
|
||||
<script language="javascript" type="text/javascript" src="{DOMAIN}/tpldata/jqplot.canvasAxisTickRenderer.min.js"></script>
|
||||
<script language="javascript" type="text/javascript" src="{DOMAIN}/tpldata/jqplot.categoryAxisRenderer.min.js"></script>
|
||||
<script language="javascript" type="text/javascript" src="{DOMAIN}/tpldata/jqplot.dateAxisRenderer.min.js"></script>
|
||||
<script language="javascript" type="text/javascript" src="{DOMAIN}/tpldata/jqplot.enhancedLegendRenderer.min.js"></script>
|
||||
<script language="javascript" type="text/javascript" src="{DOMAIN}/tpldata/jqplot.highlighter.min.js"></script>
|
||||
<script language="javascript" type="text/javascript" src="{DOMAIN}/tpldata/jqplot.logAxisRenderer.min.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="{DOMAIN}/tpldata/jquery.jqplot.css" />
|
||||
<!-- END -->
|
||||
<!-- INCLUDE admin_header.tpl -->
|
||||
|
@ -25,51 +32,51 @@
|
|||
<input type="hidden" name="build" value="1" />
|
||||
<p style="margin-top: 16px">Показатель:</p>
|
||||
<p style="margin-left: 20px">
|
||||
<select style="width:100px" name="cell_aggr">
|
||||
<!-- FOR f = aggregates -->
|
||||
<option value="{s f.id}"<!-- IF eq(cell.aggr, f.id) --> selected="selected"<!-- END -->>{s f.name}</option>
|
||||
<!-- END -->
|
||||
</select>
|
||||
<select style="width:100px" name="cell_field">
|
||||
<option value="">---</option>
|
||||
<!-- FOR f = fielddescs -->
|
||||
<option value="{s f.id}"<!-- IF eq(cell.field, f.id) --> selected="selected"<!-- SET cell.fname = f.name --><!-- END -->>{s f.name}</option>
|
||||
<!-- END -->
|
||||
</select>
|
||||
<select style="width:100px" name="cell_func">
|
||||
<option value="">без преобразования</option>
|
||||
<!-- FOR f = functions -->
|
||||
<option value="{s f.id}"<!-- IF eq(cell.func, f.id) --> selected="selected"<!-- END -->><!-- IF f.time -->(время) <!-- END -->{s f.name}</option>
|
||||
<!-- END -->
|
||||
</select>
|
||||
<select style="width:100px" name="cell_aggr">
|
||||
<!-- FOR f = aggregates -->
|
||||
<option value="{s f.id}"<!-- IF eq(cell.aggr, f.id) --> selected="selected"<!-- END -->>{s f.name}</option>
|
||||
<!-- END -->
|
||||
</select>
|
||||
<select style="width:100px" name="cell_field">
|
||||
<option value="">---</option>
|
||||
<!-- FOR f = fielddescs -->
|
||||
<option value="{s f.id}"<!-- IF eq(cell.field, f.id) --> selected="selected"<!-- END -->>{s f.name}</option>
|
||||
<!-- END -->
|
||||
</select>
|
||||
<select style="width:100px" name="cell_func">
|
||||
<option value="">без преобразования</option>
|
||||
<!-- FOR f = functions -->
|
||||
<option value="{s f.id}"<!-- IF eq(cell.func, f.id) --> selected="selected"<!-- END -->><!-- IF f.time -->(время) <!-- END -->{s f.name}</option>
|
||||
<!-- END -->
|
||||
</select>
|
||||
</p>
|
||||
<p style="margin-top: 16px">Группировка: количество полей: <input type="text" name="field_count" value="{field_count}" /></p>
|
||||
<ol>
|
||||
<!-- FOR fld = range(0,sub(field_count,1)) -->
|
||||
<li>
|
||||
<!-- SET gf = get(group_fields,fld) -->
|
||||
<p><select name="group-type-{fld}">
|
||||
<option value="">---</option>
|
||||
<!-- FOR g = group_types -->
|
||||
<option value="{g.id}"<!-- IF eq(gf.type,g.id) --> selected="selected" <!-- END -->>{g.name/s}</option>
|
||||
<!-- END -->
|
||||
</select>
|
||||
<!-- INCLUDE admin_olap_field.tpl -->
|
||||
</p>
|
||||
<p><select style="width:100px" name="group-sort_dir-{fld}">
|
||||
<option value="asc">По возрастанию</option>
|
||||
<option value="desc"<!-- IF eq(gf.sort_dir, 'desc') --> selected="selected"<!-- END -->>По убыванию</option>
|
||||
</select>
|
||||
<select style="width:100px" name="group-sort_aggr-{fld}">
|
||||
<option value="">по значениям поля</option>
|
||||
<!-- FOR f = aggregates -->
|
||||
<!-- IF NOT f.cell_only -->
|
||||
<option value="{s f.id}"<!-- IF eq(gf.sort_aggr, f.id) --> selected="selected"<!-- END -->>{s f.name} другого поля:</option>
|
||||
<!-- SET gf = get(group_fields,fld) -->
|
||||
<p><select name="group-type-{fld}">
|
||||
<option value="">---</option>
|
||||
<!-- FOR g = group_types -->
|
||||
<option value="{g.id}"<!-- IF eq(gf.type,g.id) --> selected="selected" <!-- END -->>{g.name/s}</option>
|
||||
<!-- END -->
|
||||
<!-- END -->
|
||||
</select>
|
||||
<!-- SET ft = 'sort_' --><!-- INCLUDE admin_olap_field.tpl --><!-- SET ft = '' -->
|
||||
</p>
|
||||
</select>
|
||||
<!-- INCLUDE admin_olap_field.tpl -->
|
||||
</p>
|
||||
<p><select style="width:100px" name="group-sort_dir-{fld}">
|
||||
<option value="asc">По возрастанию</option>
|
||||
<option value="desc"<!-- IF eq(gf.sort_dir, 'desc') --> selected="selected"<!-- END -->>По убыванию</option>
|
||||
</select>
|
||||
<select style="width:100px" name="group-sort_aggr-{fld}">
|
||||
<option value="">по значениям поля</option>
|
||||
<!-- FOR f = aggregates -->
|
||||
<!-- IF NOT f.cell_only -->
|
||||
<option value="{s f.id}"<!-- IF eq(gf.sort_aggr, f.id) --> selected="selected"<!-- END -->>{s f.name} другого поля:</option>
|
||||
<!-- END -->
|
||||
<!-- END -->
|
||||
</select>
|
||||
<!-- SET ft = 'sort_' --><!-- INCLUDE admin_olap_field.tpl --><!-- SET ft = '' -->
|
||||
</p>
|
||||
</li>
|
||||
<!-- END -->
|
||||
</ol>
|
||||
|
@ -77,25 +84,25 @@
|
|||
<table style="margin-left: 20px">
|
||||
<!-- FOR f = fielddescs -->
|
||||
<tr><th style="text-align: left; vertical-align: top">{s f.name}</th>
|
||||
<td style="text-align: left; vertical-align: top">
|
||||
=
|
||||
<!-- IF f.options -->
|
||||
<select style="width: 100px" name="where-eq-{f.id}">
|
||||
<option value="">любой</option>
|
||||
<!-- FOR o = f.options -->
|
||||
<option value="{s o.id}"<!-- IF o.selected --> selected="selected"<!-- END -->>{s o.name}</option>
|
||||
<!-- END -->
|
||||
</select>
|
||||
<!-- ELSE -->
|
||||
<input style="width: 100px" type="text" name="where-eq-{f.id}" value="{s get(request,concat('where-eq-',f.id))}" />
|
||||
<!-- END -->
|
||||
<!-- IF f.le_ge -->
|
||||
или ≥ <input style="width: 100px" type="text" name="where-ge-{f.id}" value="{s get(request,concat('where-ge-',f.id))}" />
|
||||
и ≤ <input style="width: 100px" type="text" name="where-le-{f.id}" value="{s get(request,concat('where-le-',f.id))}" />
|
||||
<!-- END -->
|
||||
<!-- IF f.is_time --> (YYYY-MM-DD HH:MM:SS)<!-- END -->
|
||||
{f.comment}
|
||||
</td></tr>
|
||||
<td style="text-align: left; vertical-align: top">
|
||||
=
|
||||
<!-- IF f.options -->
|
||||
<select style="width: 100px" name="where-eq-{f.id}">
|
||||
<option value="">любой</option>
|
||||
<!-- FOR o = f.options -->
|
||||
<option value="{s o.id}"<!-- IF o.selected --> selected="selected"<!-- END -->>{s o.name}</option>
|
||||
<!-- END -->
|
||||
</select>
|
||||
<!-- ELSE -->
|
||||
<input style="width: 100px" type="text" name="where-eq-{f.id}" value="{s get(request,concat('where-eq-',f.id))}" />
|
||||
<!-- END -->
|
||||
<!-- IF f.le_ge -->
|
||||
или ≥ <input style="width: 100px" type="text" name="where-ge-{f.id}" value="{s get(request,concat('where-ge-',f.id))}" />
|
||||
и ≤ <input style="width: 100px" type="text" name="where-le-{f.id}" value="{s get(request,concat('where-le-',f.id))}" />
|
||||
<!-- END -->
|
||||
<!-- IF f.is_time --> (YYYY-MM-DD HH:MM:SS)<!-- END -->
|
||||
{f.comment}
|
||||
</td></tr>
|
||||
<!-- END -->
|
||||
</table>
|
||||
<p style="margin-top: 16px"><input type="submit" style="width: 200px" value=" Построить отчёт " /></p>
|
||||
|
@ -106,147 +113,160 @@
|
|||
<!-- IF and(not tables, not graphs) -->
|
||||
<p>Нет данных для показа.</p>
|
||||
<!-- ELSIF groups -->
|
||||
<!-- FOR group = groups -->
|
||||
<div style="width: 600px; height: 300px; margin-top: 20px" id="group{group#}"></div>
|
||||
<!-- END -->
|
||||
<p>
|
||||
<input type="checkbox" name="graph_log" id="graph_log" value="1"
|
||||
onclick="doPlot(this.checked)" />
|
||||
<label for="graph_log">Логарифмическая шкала графиков</label>
|
||||
</p>
|
||||
<script language="javascript" type="text/javascript">
|
||||
var g = [
|
||||
<!-- FOR group = groups -->{yesno(group#,',','')}
|
||||
{
|
||||
<!-- FOR group = groups -->
|
||||
<div style="width: 900px; height: 400px; margin-top: 20px" id="group{group#}"></div>
|
||||
<!-- END -->
|
||||
<p>
|
||||
<input type="checkbox" name="graph_log" id="graph_log" value="1"
|
||||
onclick="doPlot(this.checked)" />
|
||||
<label for="graph_log">Логарифмическая шкала графиков</label>
|
||||
</p>
|
||||
<script language="javascript" type="text/javascript">
|
||||
var g = [
|
||||
<!-- FOR group = groups -->{yesno(group#,',','')}
|
||||
{
|
||||
id: "group{group#}",
|
||||
desc: "{q join(', ',group.full_desc)}",
|
||||
numeric: {yesno(group.numeric,'true','false')},
|
||||
data: [
|
||||
<!-- FOR graph = group.graphs -->{yesno(graph#,',','')}
|
||||
[
|
||||
<!-- FOR g = graph.data -->
|
||||
[ '{g.0}', {g.1} ],
|
||||
<!-- FOR graph = group.graphs -->{yesno(graph#,',','')}
|
||||
[
|
||||
<!-- FOR g = graph.data -->
|
||||
[ {yesno(group.numeric,g.0,concat("'",q(g.0),"'"))}, {g.1} ],
|
||||
<!-- END -->
|
||||
]
|
||||
<!-- END -->
|
||||
]
|
||||
<!-- END -->
|
||||
],
|
||||
x: "{q group.graphs.0.field}<!-- IF group.graphs.0.func --> ({q group.graphs.0.func})<!-- END -->",
|
||||
titles: [
|
||||
<!-- FOR graph = group.graphs -->{yesno(graph#,',','')}
|
||||
'{q graph.last_desc}'
|
||||
<!-- END -->
|
||||
<!-- FOR graph = group.graphs -->{yesno(graph#,',','')}
|
||||
'{q graph.last_desc}'
|
||||
<!-- END -->
|
||||
]
|
||||
}
|
||||
<!-- END -->
|
||||
];
|
||||
var yLabel = '{cell.fname}';
|
||||
var plots = [];
|
||||
function doPlot(logarithmic)
|
||||
{
|
||||
for (var i = 0; i < g.length; i++)
|
||||
{
|
||||
if (plots[i])
|
||||
plots[i].destroy();
|
||||
plots[i] = $.jqplot(g[i].id, g[i].data, {
|
||||
seriesDefaults: {},
|
||||
title: g[i].desc,
|
||||
legend: {
|
||||
show: true,
|
||||
renderer: $.jqplot.EnhancedLegendRenderer,
|
||||
location: 'ne',
|
||||
labels: g[i].titles
|
||||
},
|
||||
axesDefaults: {
|
||||
tickRenderer: $.jqplot.CanvasAxisTickRenderer,
|
||||
tickOptions: {
|
||||
fontSize: '10pt',
|
||||
}
|
||||
},
|
||||
axes: {
|
||||
xaxis: {
|
||||
label: g[i].x,
|
||||
labelRenderer: $.jqplot.CanvasAxisLabelRenderer,
|
||||
renderer: $.jqplot.CategoryAxisRenderer,
|
||||
sortMergedLabels: true,
|
||||
tickOptions: {
|
||||
angle: -30
|
||||
}
|
||||
},
|
||||
yaxis: {
|
||||
label: yLabel,
|
||||
renderer: logarithmic ? $.jqplot.LogAxisRenderer : $.jqplot.LinearAxisRenderer,
|
||||
labelRenderer: $.jqplot.CanvasAxisLabelRenderer,
|
||||
tickOptions: {
|
||||
labelPosition: 'end'
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
doPlot(false);
|
||||
</script>
|
||||
<!-- END -->
|
||||
];
|
||||
var yLabel = '{cell.value_desc}';
|
||||
var plots = [];
|
||||
$.jqplot.config.enablePlugins = true;
|
||||
$(document).ready(function(){
|
||||
doPlot($('#graph_log').attr('checked'));
|
||||
});
|
||||
function doPlot(logarithmic)
|
||||
{
|
||||
for (var i = 0; i < g.length; i++)
|
||||
{
|
||||
if (plots[i])
|
||||
plots[i].destroy();
|
||||
plots[i] = $.jqplot(g[i].id, g[i].data, {
|
||||
seriesDefaults: {},
|
||||
title: g[i].desc,
|
||||
highlighter: {
|
||||
showTooltip: true,
|
||||
bringSeriesToFront: true
|
||||
},
|
||||
cursor: {
|
||||
show: false,
|
||||
},
|
||||
legend: {
|
||||
show: true,
|
||||
renderer: $.jqplot.EnhancedLegendRenderer,
|
||||
location: 'ne',
|
||||
placement: 'outsideGrid',
|
||||
labels: g[i].titles
|
||||
},
|
||||
axesDefaults: {
|
||||
tickRenderer: $.jqplot.CanvasAxisTickRenderer,
|
||||
tickOptions: {
|
||||
fontSize: '10pt',
|
||||
}
|
||||
},
|
||||
axes: {
|
||||
xaxis: {
|
||||
label: g[i].x,
|
||||
labelRenderer: $.jqplot.CanvasAxisLabelRenderer,
|
||||
renderer: g[i].numeric ? $.jqplot.LinearAxisRenderer : $.jqplot.CategoryAxisRenderer,
|
||||
sortMergedLabels: true,
|
||||
useStringSort: true,
|
||||
tickOptions: {
|
||||
angle: -30
|
||||
}
|
||||
},
|
||||
yaxis: {
|
||||
label: yLabel,
|
||||
renderer: logarithmic ? $.jqplot.LogAxisRenderer : $.jqplot.LinearAxisRenderer,
|
||||
labelRenderer: $.jqplot.CanvasAxisLabelRenderer,
|
||||
tickOptions: {
|
||||
labelPosition: 'end'
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<!-- ELSIF graphs -->
|
||||
<!-- FOR graph = graphs -->
|
||||
<!-- IF graph.desc -->
|
||||
<!-- SET o = 0 -->
|
||||
<!-- FOR d = graph.desc -->
|
||||
<!--# Описание графика (поле: значение, ..., только значения, не равные значениям предыдущего графика) -->
|
||||
<!-- SET o = or(o, not(graph#), ne(get(get(get(get(graphs,sub(graph#,1)),'desc'),d#),'value'),d.value)) -->
|
||||
<!-- IF o -->
|
||||
<p style="margin-left: {mul(d#,20)}px">{d.field}<!-- IF d.func --> ({lc d.func})<!-- END -->: {d.value}</p>
|
||||
<!-- FOR graph = graphs -->
|
||||
<!-- IF graph.desc -->
|
||||
<!-- SET o = 0 -->
|
||||
<!-- FOR d = graph.desc -->
|
||||
<!--# Описание графика (поле: значение, ..., только значения, не равные значениям предыдущего графика) -->
|
||||
<!-- SET o = or(o, not(graph#), ne(get(get(get(get(graphs,sub(graph#,1)),'desc'),d#),'value'),d.value)) -->
|
||||
<!-- IF o -->
|
||||
<p style="margin-left: {mul(d#,20)}px">{d.field}<!-- IF d.func --> ({lc d.func})<!-- END -->: {d.value}</p>
|
||||
<!-- END -->
|
||||
<!-- END -->
|
||||
<div style="margin-left: {mul(count(graph.desc),20)}px">
|
||||
<!-- END -->
|
||||
<!-- END -->
|
||||
<div style="margin-left: {mul(count(graph.desc),20)}px">
|
||||
<!-- END -->
|
||||
<table>
|
||||
<!-- IF graph.bi_sign -->
|
||||
<tr><th colspan="4">- {graph.field}<!-- IF graph.func --> ({lc graph.func})<!-- END --> +</th></tr>
|
||||
<!-- FOR g = graph.data -->
|
||||
<tr>
|
||||
<td><div style="float: right; background: red; height: 7px; width: {g.3}px"></div></td>
|
||||
<td>{s g.0}: </td><td>{s g.1}</td>
|
||||
<td><div style="background: blue; height: 7px; width: {g.2}px"></div></td>
|
||||
</tr>
|
||||
<!-- END -->
|
||||
<!-- ELSE -->
|
||||
<tr><th style="text-align: left" colspan="2">{graph.field}<!-- IF graph.func --> ({lc graph.func})<!-- END --></th></tr>
|
||||
<!-- FOR g = graph.data -->
|
||||
<tr><td>{s g.0}: </td><td>{s g.1}</td><td><div style="background: blue; height: 7px; width: {g.2}px"></div></td></tr>
|
||||
<!-- END -->
|
||||
<!-- END -->
|
||||
</table>
|
||||
<!-- IF graph.desc -->
|
||||
</div>
|
||||
<!-- END -->
|
||||
<!-- END -->
|
||||
<!-- ELSE -->
|
||||
<!-- FOR table = tables -->
|
||||
<!-- IF table.desc -->
|
||||
<!-- SET o = 0 -->
|
||||
<!-- FOR d = table.desc -->
|
||||
<!-- SET o = or(o, not(table#), ne(get(get(get(get(tables,sub(table#,1)),'desc'),d#),'value'),d.value)) -->
|
||||
<!-- IF o -->
|
||||
<p style="margin-left: {mul(d#,20)}px">{d.field}<!-- IF d.func --> ({lc d.func})<!-- END -->: {d.value}</p>
|
||||
<!-- END -->
|
||||
<!-- END -->
|
||||
<div style="margin-left: {mul(count(table.desc),20)}px">
|
||||
<!-- END -->
|
||||
<table class="simpletable center">
|
||||
<!-- FOR row = table.rows -->
|
||||
<tr>
|
||||
<!-- FOR c = row -->
|
||||
<!-- IF is_array(c) -->
|
||||
<th<!-- IF c.colspan --> colspan="{c.colspan}"<!-- END --><!-- IF c.rowspan --> rowspan="{c.rowspan}"<!-- END --><!-- IF c.class --> class="{c.class}"<!-- END -->>{c.text}</th>
|
||||
<table>
|
||||
<!-- IF graph.bi_sign -->
|
||||
<tr><th colspan="4">- {graph.field}<!-- IF graph.func --> ({lc graph.func})<!-- END --> +</th></tr>
|
||||
<!-- FOR g = graph.data -->
|
||||
<tr>
|
||||
<td><div style="float: right; background: red; height: 7px; width: {g.3}px"></div></td>
|
||||
<td>{s g.0}: </td><td>{s g.1}</td>
|
||||
<td><div style="background: blue; height: 7px; width: {g.2}px"></div></td>
|
||||
</tr>
|
||||
<!-- END -->
|
||||
<!-- ELSE -->
|
||||
<td>{c}</td>
|
||||
<tr><th style="text-align: left" colspan="2">{graph.field}<!-- IF graph.func --> ({lc graph.func})<!-- END --></th></tr>
|
||||
<!-- FOR g = graph.data -->
|
||||
<tr><td>{s g.0}: </td><td>{s g.1}</td><td><div style="background: blue; height: 7px; width: {g.2}px"></div></td></tr>
|
||||
<!-- END -->
|
||||
<!-- END -->
|
||||
</table>
|
||||
<!-- IF graph.desc -->
|
||||
</div>
|
||||
<!-- END -->
|
||||
<!-- END -->
|
||||
</tr>
|
||||
<!-- END -->
|
||||
</table>
|
||||
<!-- IF table.desc -->
|
||||
<!-- ELSE --> <!--# Таблицы! -->
|
||||
<!-- FOR table = tables -->
|
||||
<!-- IF table.desc -->
|
||||
<!-- SET o = 0 -->
|
||||
<!-- FOR d = table.desc -->
|
||||
<!-- SET o = or(o, not(table#), ne(get(get(get(get(tables,sub(table#,1)),'desc'),d#),'value'),d.value)) -->
|
||||
<!-- IF o -->
|
||||
<p style="margin-left: {mul(d#,20)}px">{d.field}<!-- IF d.func --> ({lc d.func})<!-- END -->: {d.value}</p>
|
||||
<!-- END -->
|
||||
<!-- END -->
|
||||
<div style="margin-left: {mul(count(table.desc),20)}px">
|
||||
<!-- END -->
|
||||
<table class="simpletable center">
|
||||
<!-- FOR row = table.rows -->
|
||||
<tr>
|
||||
<!-- FOR c = row -->
|
||||
<!-- IF is_array(c) -->
|
||||
<th<!-- IF c.colspan --> colspan="{c.colspan}"<!-- END --><!-- IF c.rowspan --> rowspan="{c.rowspan}"<!-- END --><!-- IF c.class --> class="{c.class}"<!-- END -->>{c.text}</th>
|
||||
<!-- ELSE -->
|
||||
<td>{c}</td>
|
||||
<!-- END -->
|
||||
<!-- END -->
|
||||
</tr>
|
||||
<!-- END -->
|
||||
</table>
|
||||
<!-- IF table.desc -->
|
||||
</div>
|
||||
<!-- END -->
|
||||
<!-- END -->
|
||||
<!-- END -->
|
||||
<p>Отчёт занял {time_elapsed} сек. Использовано {memory} памяти для работы.</p>
|
||||
<!-- END -->
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
(function(a){a.jqplot.CanvasAxisLabelRenderer=function(b){this.angle=0;this.axis;this.show=true;this.showLabel=true;this.label="";this.fontFamily='"Trebuchet MS", Arial, Helvetica, sans-serif';this.fontSize="11pt";this.fontWeight="normal";this.fontStretch=1;this.textColor="#666666";this.enableFontSupport=true;this.pt2px=null;this._elem;this._ctx;this._plotWidth;this._plotHeight;this._plotDimensions={height:null,width:null};a.extend(true,this,b);if(b.angle==null&&this.axis!="xaxis"&&this.axis!="x2axis"){this.angle=-90}var c={fontSize:this.fontSize,fontWeight:this.fontWeight,fontStretch:this.fontStretch,fillStyle:this.textColor,angle:this.getAngleRad(),fontFamily:this.fontFamily};if(this.pt2px){c.pt2px=this.pt2px}if(this.enableFontSupport){if(a.jqplot.support_canvas_text()){this._textRenderer=new a.jqplot.CanvasFontRenderer(c)}else{this._textRenderer=new a.jqplot.CanvasTextRenderer(c)}}else{this._textRenderer=new a.jqplot.CanvasTextRenderer(c)}};a.jqplot.CanvasAxisLabelRenderer.prototype.init=function(b){a.extend(true,this,b);this._textRenderer.init({fontSize:this.fontSize,fontWeight:this.fontWeight,fontStretch:this.fontStretch,fillStyle:this.textColor,angle:this.getAngleRad(),fontFamily:this.fontFamily})};a.jqplot.CanvasAxisLabelRenderer.prototype.getWidth=function(d){if(this._elem){return this._elem.outerWidth(true)}else{var f=this._textRenderer;var c=f.getWidth(d);var e=f.getHeight(d);var b=Math.abs(Math.sin(f.angle)*e)+Math.abs(Math.cos(f.angle)*c);return b}};a.jqplot.CanvasAxisLabelRenderer.prototype.getHeight=function(d){if(this._elem){return this._elem.outerHeight(true)}else{var f=this._textRenderer;var c=f.getWidth(d);var e=f.getHeight(d);var b=Math.abs(Math.cos(f.angle)*e)+Math.abs(Math.sin(f.angle)*c);return b}};a.jqplot.CanvasAxisLabelRenderer.prototype.getAngleRad=function(){var b=this.angle*Math.PI/180;return b};a.jqplot.CanvasAxisLabelRenderer.prototype.draw=function(c,f){if(this._elem){if(a.jqplot.use_excanvas&&window.G_vmlCanvasManager.uninitElement!==undefined){window.G_vmlCanvasManager.uninitElement(this._elem.get(0))}this._elem.emptyForce();this._elem=null}var e=f.canvasManager.getCanvas();this._textRenderer.setText(this.label,c);var b=this.getWidth(c);var d=this.getHeight(c);e.width=b;e.height=d;e.style.width=b;e.style.height=d;e=f.canvasManager.initCanvas(e);this._elem=a(e);this._elem.css({position:"absolute"});this._elem.addClass("jqplot-"+this.axis+"-label");e=null;return this._elem};a.jqplot.CanvasAxisLabelRenderer.prototype.pack=function(){this._textRenderer.draw(this._elem.get(0).getContext("2d"),this.label)}})(jQuery);
|
|
@ -0,0 +1 @@
|
|||
(function(a){a.jqplot.CanvasAxisTickRenderer=function(b){this.mark="outside";this.showMark=true;this.showGridline=true;this.isMinorTick=false;this.angle=0;this.markSize=4;this.show=true;this.showLabel=true;this.labelPosition="auto";this.label="";this.value=null;this._styles={};this.formatter=a.jqplot.DefaultTickFormatter;this.formatString="";this.prefix="";this.fontFamily='"Trebuchet MS", Arial, Helvetica, sans-serif';this.fontSize="10pt";this.fontWeight="normal";this.fontStretch=1;this.textColor="#666666";this.enableFontSupport=true;this.pt2px=null;this._elem;this._ctx;this._plotWidth;this._plotHeight;this._plotDimensions={height:null,width:null};a.extend(true,this,b);var c={fontSize:this.fontSize,fontWeight:this.fontWeight,fontStretch:this.fontStretch,fillStyle:this.textColor,angle:this.getAngleRad(),fontFamily:this.fontFamily};if(this.pt2px){c.pt2px=this.pt2px}if(this.enableFontSupport){if(a.jqplot.support_canvas_text()){this._textRenderer=new a.jqplot.CanvasFontRenderer(c)}else{this._textRenderer=new a.jqplot.CanvasTextRenderer(c)}}else{this._textRenderer=new a.jqplot.CanvasTextRenderer(c)}};a.jqplot.CanvasAxisTickRenderer.prototype.init=function(b){a.extend(true,this,b);this._textRenderer.init({fontSize:this.fontSize,fontWeight:this.fontWeight,fontStretch:this.fontStretch,fillStyle:this.textColor,angle:this.getAngleRad(),fontFamily:this.fontFamily})};a.jqplot.CanvasAxisTickRenderer.prototype.getWidth=function(d){if(this._elem){return this._elem.outerWidth(true)}else{var f=this._textRenderer;var c=f.getWidth(d);var e=f.getHeight(d);var b=Math.abs(Math.sin(f.angle)*e)+Math.abs(Math.cos(f.angle)*c);return b}};a.jqplot.CanvasAxisTickRenderer.prototype.getHeight=function(d){if(this._elem){return this._elem.outerHeight(true)}else{var f=this._textRenderer;var c=f.getWidth(d);var e=f.getHeight(d);var b=Math.abs(Math.cos(f.angle)*e)+Math.abs(Math.sin(f.angle)*c);return b}};a.jqplot.CanvasAxisTickRenderer.prototype.getAngleRad=function(){var b=this.angle*Math.PI/180;return b};a.jqplot.CanvasAxisTickRenderer.prototype.setTick=function(b,d,c){this.value=b;if(c){this.isMinorTick=true}return this};a.jqplot.CanvasAxisTickRenderer.prototype.draw=function(c,f){if(!this.label){this.label=this.prefix+this.formatter(this.formatString,this.value)}if(this._elem){if(a.jqplot.use_excanvas&&window.G_vmlCanvasManager.uninitElement!==undefined){window.G_vmlCanvasManager.uninitElement(this._elem.get(0))}this._elem.emptyForce();this._elem=null}var e=f.canvasManager.getCanvas();this._textRenderer.setText(this.label,c);var b=this.getWidth(c);var d=this.getHeight(c);e.width=b;e.height=d;e.style.width=b;e.style.height=d;e.style.textAlign="left";e.style.position="absolute";e=f.canvasManager.initCanvas(e);this._elem=a(e);this._elem.css(this._styles);this._elem.addClass("jqplot-"+this.axis+"-tick");e=null;return this._elem};a.jqplot.CanvasAxisTickRenderer.prototype.pack=function(){this._textRenderer.draw(this._elem.get(0).getContext("2d"),this.label)}})(jQuery);
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1 @@
|
|||
(function(c){c.jqplot.EnhancedLegendRenderer=function(){c.jqplot.TableLegendRenderer.call(this)};c.jqplot.EnhancedLegendRenderer.prototype=new c.jqplot.TableLegendRenderer();c.jqplot.EnhancedLegendRenderer.prototype.constructor=c.jqplot.EnhancedLegendRenderer;c.jqplot.EnhancedLegendRenderer.prototype.init=function(d){this.numberRows=null;this.numberColumns=null;this.seriesToggle="normal";this.seriesToggleReplot=false;this.disableIEFading=true;c.extend(true,this,d);if(this.seriesToggle){c.jqplot.postDrawHooks.push(b)}};c.jqplot.EnhancedLegendRenderer.prototype.draw=function(m,z){var r=this;if(this.show){var g=this._series;var u;var w="position:absolute;";w+=(this.background)?"background:"+this.background+";":"";w+=(this.border)?"border:"+this.border+";":"";w+=(this.fontSize)?"font-size:"+this.fontSize+";":"";w+=(this.fontFamily)?"font-family:"+this.fontFamily+";":"";w+=(this.textColor)?"color:"+this.textColor+";":"";w+=(this.marginTop!=null)?"margin-top:"+this.marginTop+";":"";w+=(this.marginBottom!=null)?"margin-bottom:"+this.marginBottom+";":"";w+=(this.marginLeft!=null)?"margin-left:"+this.marginLeft+";":"";w+=(this.marginRight!=null)?"margin-right:"+this.marginRight+";":"";this._elem=c('<table class="jqplot-table-legend" style="'+w+'"></table>');if(this.seriesToggle){this._elem.css("z-index","3")}var C=false,q=false,d,o;if(this.numberRows){d=this.numberRows;if(!this.numberColumns){o=Math.ceil(g.length/d)}else{o=this.numberColumns}}else{if(this.numberColumns){o=this.numberColumns;d=Math.ceil(g.length/this.numberColumns)}else{d=g.length;o=1}}var B,y,e,l,k,n,p,t,h,f;var v=0;for(B=g.length-1;B>=0;B--){if(o==1&&g[B]._stack||g[B].renderer.constructor==c.jqplot.BezierCurveRenderer){q=true}}for(B=0;B<d;B++){e=c(document.createElement("tr"));e.addClass("jqplot-table-legend");if(q){e.prependTo(this._elem)}else{e.appendTo(this._elem)}for(y=0;y<o;y++){if(v<g.length&&(g[v].show||g[v].showLabel)){u=g[v];n=this.labels[v]||u.label.toString();if(n){var x=u.color;if(!q){if(B>0){C=true}else{C=false}}else{if(B==d-1){C=false}else{C=true}}p=(C)?this.rowSpacing:"0";l=c(document.createElement("td"));l.addClass("jqplot-table-legend jqplot-table-legend-swatch");l.css({textAlign:"center",paddingTop:p});h=c(document.createElement("div"));h.addClass("jqplot-table-legend-swatch-outline");f=c(document.createElement("div"));f.addClass("jqplot-table-legend-swatch");f.css({backgroundColor:x,borderColor:x});l.append(h.append(f));k=c(document.createElement("td"));k.addClass("jqplot-table-legend jqplot-table-legend-label");k.css("paddingTop",p);if(this.escapeHtml){k.text(n)}else{k.html(n)}if(q){if(this.showLabels){k.prependTo(e)}if(this.showSwatches){l.prependTo(e)}}else{if(this.showSwatches){l.appendTo(e)}if(this.showLabels){k.appendTo(e)}}if(this.seriesToggle){var A;if(typeof(this.seriesToggle)==="string"||typeof(this.seriesToggle)==="number"){if(!c.jqplot.use_excanvas||!this.disableIEFading){A=this.seriesToggle}}if(this.showSwatches){l.bind("click",{series:u,speed:A,plot:z,replot:this.seriesToggleReplot},a);l.addClass("jqplot-seriesToggle")}if(this.showLabels){k.bind("click",{series:u,speed:A,plot:z,replot:this.seriesToggleReplot},a);k.addClass("jqplot-seriesToggle")}if(!u.show&&u.showLabel){l.addClass("jqplot-series-hidden");k.addClass("jqplot-series-hidden")}}C=true}}v++}l=k=h=f=null}}return this._elem};var a=function(j){var i=j.data,m=i.series,l=i.replot,h=i.plot,f=i.speed,k=m.index,g=false;if(m.canvas._elem.is(":hidden")||!m.show){g=true}var e=function(){if(l){var n={};if(c.isPlainObject(l)){c.extend(true,n,l)}h.replot(n);if(g&&f){var d=h.series[k];if(d.shadowCanvas._elem){d.shadowCanvas._elem.hide().fadeIn(f)}d.canvas._elem.hide().fadeIn(f);d.canvas._elem.nextAll(".jqplot-point-label.jqplot-series-"+d.index).hide().fadeIn(f)}}else{var d=h.series[k];if(d.canvas._elem.is(":hidden")||!d.show){if(typeof h.options.legend.showSwatches==="undefined"||h.options.legend.showSwatches===true){h.legend._elem.find("td").eq(k*2).addClass("jqplot-series-hidden")}if(typeof h.options.legend.showLabels==="undefined"||h.options.legend.showLabels===true){h.legend._elem.find("td").eq((k*2)+1).addClass("jqplot-series-hidden")}}else{if(typeof h.options.legend.showSwatches==="undefined"||h.options.legend.showSwatches===true){h.legend._elem.find("td").eq(k*2).removeClass("jqplot-series-hidden")}if(typeof h.options.legend.showLabels==="undefined"||h.options.legend.showLabels===true){h.legend._elem.find("td").eq((k*2)+1).removeClass("jqplot-series-hidden")}}}};m.toggleDisplay(j,e)};var b=function(){if(this.legend.renderer.constructor==c.jqplot.EnhancedLegendRenderer&&this.legend.seriesToggle){var d=this.legend._elem.detach();this.eventCanvas._elem.after(d)}}})(jQuery);
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue