Tooltips, smooth = true

master
vitalif 2012-03-10 22:27:34 +00:00
parent 5a85e15b90
commit 5e79220911
2 changed files with 16 additions and 3 deletions

View File

@ -228,8 +228,12 @@ class OLAP
$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'].')';
$this->cell['value_desc_brace'] = $this->cell['value_desc'];
if ($this->cell['aggr_name'])
{
$this->cell['value_desc_brace'] = $this->cell['aggr_name'].' ('.$this->cell['value_desc'].')';
$this->cell['value_desc'] = $this->cell['aggr_name'].': '.$this->cell['value_desc'];
}
// Запрос на построение?
$this->build = !empty($request['build']);

View File

@ -58,7 +58,7 @@
<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>
<option value="{g.id}"<!-- IF eq(gf.type,g.id) --> selected="selected" <!-- END -->>{s g.name}</option>
<!-- END -->
</select>
<!-- INCLUDE admin_olap_field.tpl -->
@ -159,6 +159,7 @@ var g = [
<!-- END -->
];
var yLabel = '{cell.value_desc}';
var yLabelBr = '{cell.value_desc_brace}';
var plots = [];
$.jqplot.config.enablePlugins = true;
$(document).ready(function(){
@ -168,14 +169,22 @@ function doPlot(logarithmic)
{
for (var i = 0; i < g.length; i++)
{
var ik = i;
if (plots[i])
plots[i].destroy();
plots[i] = $.jqplot(g[i].id, g[i].data, {
seriesDefaults: {},
seriesDefaults: {
rendererOptions: { smooth: true }
},
title: g[i].desc,
highlighter: {
showTooltip: true,
bringSeriesToFront: true
bringSeriesToFront: true,
tooltipAxes: 'x',
tooltipContentEditor: function(str, series, point, plot) {
var p = g[ik].data[series][point];
return g[ik].x+' = '+p[0]+'<br />'+yLabelBr+' = '+p[1];
},
},
cursor: {
show: false,