mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-28 16:24:04 +02:00
Fix coding style
This commit is contained in:
parent
ec3bafa026
commit
8d697a3d8e
@ -29,14 +29,14 @@
|
||||
|
||||
namespace Icinga\Chart;
|
||||
|
||||
use \DOMElement;
|
||||
use \Icinga\Chart\Primitive\Drawable;
|
||||
use \Icinga\Chart\Primitive\Line;
|
||||
use \Icinga\Chart\Primitive\Text;
|
||||
use \Icinga\Chart\Render\RenderContext;
|
||||
use \Icinga\Chart\Unit\AxisUnit;
|
||||
use \Icinga\Chart\Unit\CalendarUnit;
|
||||
use \Icinga\Chart\Unit\LinearUnit;
|
||||
use DOMElement;
|
||||
use Icinga\Chart\Primitive\Drawable;
|
||||
use Icinga\Chart\Primitive\Line;
|
||||
use Icinga\Chart\Primitive\Text;
|
||||
use Icinga\Chart\Render\RenderContext;
|
||||
use Icinga\Chart\Unit\AxisUnit;
|
||||
use Icinga\Chart\Unit\CalendarUnit;
|
||||
use Icinga\Chart\Unit\LinearUnit;
|
||||
|
||||
/**
|
||||
* Axis class for the GridChart class.
|
||||
|
@ -29,11 +29,11 @@
|
||||
|
||||
namespace Icinga\Chart;
|
||||
|
||||
use \Exception;
|
||||
use \Icinga\Chart\Legend;
|
||||
use \Icinga\Chart\Palette;
|
||||
use \Icinga\Chart\Primitive\Drawable;
|
||||
use \Icinga\Chart\SVGRenderer;
|
||||
use Exception;
|
||||
use Icinga\Chart\Legend;
|
||||
use Icinga\Chart\Palette;
|
||||
use Icinga\Chart\Primitive\Drawable;
|
||||
use Icinga\Chart\SVGRenderer;
|
||||
|
||||
/**
|
||||
* Base class for charts, extended by all other Chart classes.
|
||||
|
@ -29,12 +29,12 @@
|
||||
|
||||
namespace Icinga\Chart\Graph;
|
||||
|
||||
use \DOMElement;
|
||||
use \Icinga\Chart\Primitive\Animation;
|
||||
use \Icinga\Chart\Primitive\Drawable;
|
||||
use \Icinga\Chart\Primitive\Rect;
|
||||
use \Icinga\Chart\Primitive\Styleable;
|
||||
use \Icinga\Chart\Render\RenderContext;
|
||||
use DOMElement;
|
||||
use Icinga\Chart\Primitive\Animation;
|
||||
use Icinga\Chart\Primitive\Drawable;
|
||||
use Icinga\Chart\Primitive\Rect;
|
||||
use Icinga\Chart\Primitive\Styleable;
|
||||
use Icinga\Chart\Render\RenderContext;
|
||||
|
||||
/**
|
||||
* Bar graph implementation
|
||||
@ -94,7 +94,7 @@ class BarGraph extends Styleable implements Drawable
|
||||
$group = $doc->createElement('g');
|
||||
$idx = 0;
|
||||
foreach ($this->dataSet as $point) {
|
||||
$rect = new Rect($point[0]-1, $point[1], $this->barWidth, 100- $point[1]);
|
||||
$rect = new Rect($point[0] - 1, $point[1], 2, 100 - $point[1]);
|
||||
$rect->setFill($this->fill);
|
||||
$rect->setStrokeWidth($this->strokeWidth);
|
||||
$rect->setStrokeColor('black');
|
||||
|
@ -30,12 +30,12 @@
|
||||
|
||||
namespace Icinga\Chart\Graph;
|
||||
|
||||
use \DOMElement;
|
||||
use \Icinga\Chart\Primitive\Drawable;
|
||||
use \Icinga\Chart\Primitive\Path;
|
||||
use \Icinga\Chart\Primitive\Circle;
|
||||
use \Icinga\Chart\Primitive\Styleable;
|
||||
use \Icinga\Chart\Render\RenderContext;
|
||||
use DOMElement;
|
||||
use Icinga\Chart\Primitive\Drawable;
|
||||
use Icinga\Chart\Primitive\Path;
|
||||
use Icinga\Chart\Primitive\Circle;
|
||||
use Icinga\Chart\Primitive\Styleable;
|
||||
use Icinga\Chart\Render\RenderContext;
|
||||
|
||||
/**
|
||||
* LineGraph implementation for drawing a set of datapoints as
|
||||
|
@ -29,9 +29,9 @@
|
||||
|
||||
namespace Icinga\Chart\Graph;
|
||||
|
||||
use \DOMElement;
|
||||
use \Icinga\Chart\Primitive\Drawable;
|
||||
use \Icinga\Chart\Render\RenderContext;
|
||||
use DOMElement;
|
||||
use Icinga\Chart\Primitive\Drawable;
|
||||
use Icinga\Chart\Render\RenderContext;
|
||||
|
||||
/**
|
||||
* Graph implementation that stacks several graphs and displays them in a cumulative way
|
||||
|
@ -29,18 +29,18 @@
|
||||
|
||||
namespace Icinga\Chart;
|
||||
|
||||
use \DOMElement;
|
||||
use \Icinga\Chart\Chart;
|
||||
use \Icinga\Chart\Axis;
|
||||
use \Icinga\Chart\Graph\BarGraph;
|
||||
use \Icinga\Chart\Graph\LineGraph;
|
||||
use \Icinga\Chart\Graph\StackedGraph;
|
||||
use \Icinga\Chart\Primitive\Canvas;
|
||||
use \Icinga\Chart\Primitive\Rect;
|
||||
use \Icinga\Chart\Primitive\Path;
|
||||
use \Icinga\Chart\Render\LayoutBox;
|
||||
use \Icinga\Chart\Render\RenderContext;
|
||||
use \Icinga\Chart\Unit\AxisUnit;
|
||||
use DOMElement;
|
||||
use Icinga\Chart\Chart;
|
||||
use Icinga\Chart\Axis;
|
||||
use Icinga\Chart\Graph\BarGraph;
|
||||
use Icinga\Chart\Graph\LineGraph;
|
||||
use Icinga\Chart\Graph\StackedGraph;
|
||||
use Icinga\Chart\Primitive\Canvas;
|
||||
use Icinga\Chart\Primitive\Rect;
|
||||
use Icinga\Chart\Primitive\Path;
|
||||
use Icinga\Chart\Render\LayoutBox;
|
||||
use Icinga\Chart\Render\RenderContext;
|
||||
use Icinga\Chart\Unit\AxisUnit;
|
||||
|
||||
/**
|
||||
* Base class for grid based charts.
|
||||
|
@ -40,7 +40,8 @@ namespace Icinga\Chart\Inline;
|
||||
* Class Inline
|
||||
* @package Icinga\Chart\Inline
|
||||
*/
|
||||
class Inline {
|
||||
class Inline
|
||||
{
|
||||
|
||||
/**
|
||||
* The data displayed in this chart
|
||||
|
@ -29,14 +29,14 @@
|
||||
|
||||
namespace Icinga\Chart;
|
||||
|
||||
use \DOMElement;
|
||||
use \Icinga\Chart\Palette;
|
||||
use \Icinga\Chart\Primitive\Canvas;
|
||||
use \Icinga\Chart\Primitive\Drawable;
|
||||
use \Icinga\Chart\Primitive\Rect;
|
||||
use \Icinga\Chart\Primitive\Text;
|
||||
use \Icinga\Chart\Render\LayoutBox;
|
||||
use \Icinga\Chart\Render\RenderContext;
|
||||
use DOMElement;
|
||||
use Icinga\Chart\Palette;
|
||||
use Icinga\Chart\Primitive\Canvas;
|
||||
use Icinga\Chart\Primitive\Drawable;
|
||||
use Icinga\Chart\Primitive\Rect;
|
||||
use Icinga\Chart\Primitive\Text;
|
||||
use Icinga\Chart\Render\LayoutBox;
|
||||
use Icinga\Chart\Render\RenderContext;
|
||||
|
||||
/**
|
||||
* Drawable for creating a Graph Legend on the bottom of a graph.
|
||||
|
@ -29,14 +29,14 @@
|
||||
|
||||
namespace Icinga\Chart;
|
||||
|
||||
use \DOMElement;
|
||||
use \Icinga\Chart\Chart;
|
||||
use \Icinga\Chart\Primitive\Canvas;
|
||||
use \Icinga\Chart\Primitive\PieSlice;
|
||||
use \Icinga\Chart\Primitive\RawElement;
|
||||
use \Icinga\Chart\Primitive\Rect;
|
||||
use \Icinga\Chart\Render\RenderContext;
|
||||
use \Icinga\Chart\Render\LayoutBox;
|
||||
use DOMElement;
|
||||
use Icinga\Chart\Chart;
|
||||
use Icinga\Chart\Primitive\Canvas;
|
||||
use Icinga\Chart\Primitive\PieSlice;
|
||||
use Icinga\Chart\Primitive\RawElement;
|
||||
use Icinga\Chart\Primitive\Rect;
|
||||
use Icinga\Chart\Render\RenderContext;
|
||||
use Icinga\Chart\Render\LayoutBox;
|
||||
|
||||
/**
|
||||
* Graphing component for rendering Pie Charts.
|
||||
|
@ -29,8 +29,8 @@
|
||||
|
||||
namespace Icinga\Chart\Primitive;
|
||||
|
||||
use \DOMElement;
|
||||
use \Icinga\Chart\Render\RenderContext;
|
||||
use DOMElement;
|
||||
use Icinga\Chart\Render\RenderContext;
|
||||
|
||||
/**
|
||||
* Base interface for animatable objects
|
||||
|
@ -29,8 +29,8 @@
|
||||
|
||||
namespace Icinga\Chart\Primitive;
|
||||
|
||||
use \DOMElement;
|
||||
use \Icinga\Chart\Render\RenderContext;
|
||||
use DOMElement;
|
||||
use Icinga\Chart\Render\RenderContext;
|
||||
|
||||
/**
|
||||
* Drawable for the SVG animate tag
|
||||
|
@ -30,9 +30,9 @@
|
||||
|
||||
namespace Icinga\Chart\Primitive;
|
||||
|
||||
use \DOMElement;
|
||||
use \Icinga\Chart\Render\LayoutBox;
|
||||
use \Icinga\Chart\Render\RenderContext;
|
||||
use DOMElement;
|
||||
use Icinga\Chart\Render\LayoutBox;
|
||||
use Icinga\Chart\Render\RenderContext;
|
||||
|
||||
/**
|
||||
* Canvas SVG component that encapsulates grouping and padding and allows rendering
|
||||
|
@ -30,8 +30,9 @@
|
||||
|
||||
namespace Icinga\Chart\Primitive;
|
||||
|
||||
use \DOMElement;
|
||||
use \Icinga\Chart\Render\RenderContext;
|
||||
use DOMElement;
|
||||
use Icinga\Chart\Render\RenderContext;
|
||||
use Icinga\Chart\Format;
|
||||
|
||||
/**
|
||||
* Drawable for svg circles
|
||||
|
@ -29,8 +29,8 @@
|
||||
|
||||
namespace Icinga\Chart\Primitive;
|
||||
|
||||
use \DOMElement;
|
||||
use \Icinga\Chart\Render\RenderContext;
|
||||
use DOMElement;
|
||||
use Icinga\Chart\Render\RenderContext;
|
||||
|
||||
/**
|
||||
* Drawable element for creating svg out of components
|
||||
|
@ -29,8 +29,9 @@
|
||||
|
||||
namespace Icinga\Chart\Primitive;
|
||||
|
||||
use \DOMElement;
|
||||
use \Icinga\Chart\Render\RenderContext;
|
||||
use DOMElement;
|
||||
use Icinga\Chart\Render\RenderContext;
|
||||
use Icinga\Chart\Format;
|
||||
|
||||
/**
|
||||
* Drawable for the svg line element
|
||||
|
@ -29,8 +29,8 @@
|
||||
|
||||
namespace Icinga\Chart\Primitive;
|
||||
|
||||
use \DOMElement;
|
||||
use \Icinga\Chart\Render\RenderContext;
|
||||
use DOMElement;
|
||||
use Icinga\Chart\Render\RenderContext;
|
||||
|
||||
/**
|
||||
* Wrapper for raw elements to be added as Drawable's
|
||||
|
@ -30,7 +30,7 @@
|
||||
|
||||
namespace Icinga\Chart\Primitive;
|
||||
|
||||
use \DOMElement;
|
||||
use DOMElement;
|
||||
|
||||
/**
|
||||
* Base class for stylable drawables
|
||||
|
@ -29,14 +29,13 @@
|
||||
|
||||
namespace Icinga\Chart;
|
||||
|
||||
use \DOMNode;
|
||||
use \DOMElement;
|
||||
use \DOMDocument;
|
||||
use \DOMImplementation;
|
||||
use \Icinga\Util\Dimension;
|
||||
use \Icinga\Chart\Render\LayoutBox;
|
||||
use \Icinga\Chart\Render\RenderContext;
|
||||
use \Icinga\Chart\Primitive\Canvas;
|
||||
use DOMNode;
|
||||
use DOMElement;
|
||||
use DOMDocument;
|
||||
use DOMImplementation;
|
||||
use Icinga\Chart\Render\LayoutBox;
|
||||
use Icinga\Chart\Render\RenderContext;
|
||||
use Icinga\Chart\Primitive\Canvas;
|
||||
|
||||
/**
|
||||
* SVG Renderer component.
|
||||
|
@ -30,10 +30,7 @@
|
||||
|
||||
namespace Icinga\Chart\Unit;
|
||||
|
||||
use \Zend_Config;
|
||||
use \Icinga\Application\Icinga;
|
||||
use \Icinga\Application\Config as IcingaConfig;
|
||||
use \Icinga\Util\DateTimeFactory;
|
||||
use Icinga\Util\DateTimeFactory;
|
||||
|
||||
/**
|
||||
* Calendar Axis Unit that transforms timestamps into user-readable values
|
||||
|
@ -35,10 +35,12 @@ class StaticAxis implements AxisUnit
|
||||
private $items = array();
|
||||
|
||||
/**
|
||||
* Add a dataset to this AxisUnit, required for dynamic min and max vlaues
|
||||
* Add a dataset to this AxisUnit, required for dynamic min and max values
|
||||
*
|
||||
* @param array $dataset The dataset that will be shown in the Axis
|
||||
* @param int $id The idx in the dataset (0 for x, 1 for y)
|
||||
* @param int $idx The idx in the dataset (0 for x, 1 for y)
|
||||
*
|
||||
* @return self Fluent interface
|
||||
*/
|
||||
public function addValues(array $dataset, $idx = 0)
|
||||
{
|
||||
|
@ -47,15 +47,15 @@ use Icinga\Chart\Unit\StaticAxis;
|
||||
|
||||
class Monitoring_ChartController extends Controller
|
||||
{
|
||||
public function testAction() {
|
||||
public function testAction()
|
||||
{
|
||||
$this->chart = new GridChart();
|
||||
$this->chart->setAxisLabel('X axis label', 'Y axis label')->setXAxis(new StaticAxis());
|
||||
$data1 = array();
|
||||
$data2 = array();
|
||||
$data3 = array();
|
||||
for ($i=0; $i<25; $i++) {
|
||||
|
||||
$data3[] = array('Label ' . $i, rand(0,30));
|
||||
for ($i = 0; $i < 25; $i++) {
|
||||
$data3[] = array('Label ' . $i, rand(0, 30));
|
||||
}
|
||||
|
||||
/*
|
||||
@ -200,9 +200,18 @@ class Monitoring_ChartController extends Controller
|
||||
$downBars = array();
|
||||
$unreachableBars = array();
|
||||
foreach ($query as $hostgroup) {
|
||||
$upBars[] = array($hostgroup->hostgroup, $hostgroup->hosts_up);
|
||||
$downBars[] = array($hostgroup->hostgroup, $hostgroup->hosts_down_unhandled);
|
||||
$unreachableBars[] = array($hostgroup->hostgroup, $hostgroup->hosts_unreachable_unhandled);
|
||||
$upBars[] = array(
|
||||
$hostgroup->hostgroup,
|
||||
$hostgroup->hosts_up
|
||||
);
|
||||
$downBars[] = array(
|
||||
$hostgroup->hostgroup,
|
||||
$hostgroup->hosts_down_unhandled
|
||||
);
|
||||
$unreachableBars[] = array(
|
||||
$hostgroup->hostgroup,
|
||||
$hostgroup->hosts_unreachable_unhandled
|
||||
);
|
||||
}
|
||||
$this->view->chart = new GridChart();
|
||||
$this->view->chart->setAxisLabel('', 'Hosts')->setXAxis(new StaticAxis());
|
||||
|
Loading…
x
Reference in New Issue
Block a user