Period
A Period class defines a dashboard date range and the buckets used to plot it. Obtain registered Period class names from Metrix::$plugin->getPeriods()->getAllPeriodTypes(). Custom Periods extend verbb\metrix\base\Period and implement the static methods below; see Custom Period for a complete registration example.
use verbb\metrix\Metrix;
foreach (Metrix::$plugin->getPeriods()->getAllPeriodTypes() as $periodClass) {
$label = $periodClass::displayName();
$range = $periodClass::getDateRange();
}Static Methods
Returns the display name of the period.
Returns the display name of the previous period.
Returns start and end DateTime values for the period. All Time returns an empty array; providers determine the available history for that range.
Returns start and end DateTime values for the comparison period. All Time returns an empty array and has no comparison period.
Returns one of the Period::INTERVAL_* constants used to group provider data.
Returns the ordered dimension keys required for the chart. Use $widgetData and $rawData when the available buckets depend on the Widget or provider response.
Returns chart metadata such as xAxisLabelFormat and tooltipFormat.