PHP Class Piwik\Plugins\CoreVisualizations\JqplotDataGenerator

Supports pie graphs, bar graphs and time serieses (aka, evolution graphs).
显示文件 Open project: piwik/piwik Class Usage Examples

Protected Properties

Property Type Description
$graphType
$properties array @see Piwik\ViewDataTable for more info.

Public Methods

Method Description
__construct ( array $properties, string $graphType ) Constructor.
factory ( string $type, array $properties ) : JqplotDataGenerator Creates a new JqplotDataGenerator instance for a graph type and view properties.
generate ( DataTable | Piwik\DataTable\Map $dataTable ) : string Generates JSON graph data and returns it.

Protected Methods

Method Description
getUnitsForColumnsToDisplay ( )
initChartObjectData ( DataTable | Piwik\DataTable\Map $dataTable, $visualization )

Private Methods

Method Description
deriveUnitsFromRequestedColumnNames ( )

Method Details

__construct() public method

Constructor.
public __construct ( array $properties, string $graphType )
$properties array
$graphType string

factory() public static method

Creates a new JqplotDataGenerator instance for a graph type and view properties.
public static factory ( string $type, array $properties ) : JqplotDataGenerator
$type string 'pie', 'bar', or 'evolution'
$properties array The view properties.
return JqplotDataGenerator

generate() public method

Generates JSON graph data and returns it.
public generate ( DataTable | Piwik\DataTable\Map $dataTable ) : string
$dataTable Piwik\DataTable | Piwik\DataTable\Map
return string

getUnitsForColumnsToDisplay() protected method

initChartObjectData() protected method

protected initChartObjectData ( DataTable | Piwik\DataTable\Map $dataTable, $visualization )
$dataTable Piwik\DataTable | Piwik\DataTable\Map
$visualization

Property Details

$graphType protected_oe property

protected $graphType

$properties protected_oe property

@see Piwik\ViewDataTable for more info.
protected array $properties
return array